If you have not already seen https://gist.github.com/jogboms/7bc0318e9b33a4b4817306c5333a6cf3 then do have a look before this as this is only an extension to support the Flutter framework.
You can see this in action via this DartPad
| #!/usr/bin/env bash | |
| # Strict mode: Exit on error, undefined vars, or pipe failures | |
| set -euo pipefail | |
| # ================================================== | |
| # CONFIG — Define your target environment here | |
| # ================================================== | |
| DESIRED_GRADLE_VERSION="8.13" | |
| DESIRED_JAVA_VERSION="17" | |
| DESIRED_NDK_VERSION="29.0.14206865" |
| #!/bin/bash | |
| # Update Gradle, Java and other Android project settings in a Flutter project | |
| # Works with both .gradle and .gradle.kts build files | |
| # See: https://gradle.org/releases/ | |
| # See: https://developer.android.com/build/releases/gradle-plugin#compatibility | |
| DESIRED_GRADLE_VERSION="8.11.1" | |
| # Build errors often show the required Java version | |
| DESIRED_JAVA_VERSION="17" | |
| # See: https://developer.android.com/ndk/downloads |
| void main() async { | |
| WidgetsFlutterBinding.ensureInitialized(); | |
| await Firebase.initializeApp( | |
| options: DefaultFirebaseOptions.currentPlatform, | |
| ); | |
| await NotificationService.instance.initialize(); | |
| //YOUR OTHER CODE CAN COME IN HERE | |
| runApp(const MyApp()); |
| (T?, Object?) tryCatch<T extends Object>(T Function() function) { | |
| try { | |
| final result = function.call(); | |
| return (result, null); | |
| } catch (error) { | |
| return (null, error); | |
| } | |
| } | |
| Future<(T?, Object?)> tryCatchAsync<T extends Object>( |
If you have not already seen https://gist.github.com/jogboms/7bc0318e9b33a4b4817306c5333a6cf3 then do have a look before this as this is only an extension to support the Flutter framework.
You can see this in action via this DartPad
This is an attempt to recreate to a degree the essence of Riverpod. There is also a Flutter version https://gist.github.com/jogboms/f7f44f11e2d9aa30d355f94f5257281d.
Warning
As you would later notice, there are two major missing pieces: A robust error handling mechanism & Tests. The goal is educational and not a replacement of the said library.
See the hosted version on DartPad.
| import 'package:flutter/material.dart'; | |
| /// A progress indicator that is divided into sections, each section represents a part of the total progress | |
| /// The current position of the progress indicator is represented by the [current] property | |
| /// The [sections] property represents the sections of the progress indicator | |
| /// The length of the [sections] list represents the total number of sections | |
| class MultiProgressIndicator extends StatelessWidget { | |
| /// The current position of the progress indicator in relation to the sections | |
| final int current; |
| allprojects { | |
| repositories { | |
| google() | |
| mavenCentral() | |
| } | |
| } | |
| rootProject.buildDir = '../build' | |
| subprojects { | |
| afterEvaluate { project -> |
| import 'dart:async'; | |
| import 'package:flutter/foundation.dart'; | |
| import 'package:flutter/material.dart'; | |
| import 'package:uri/uri.dart'; | |
| class PathRouteMatch { | |
| PathRouteMatch({ | |
| required this.parameters, | |
| required this.route, |
import 'dart:math';
import 'package:flutter_dotenv/flutter_dotenv.dart';
import 'package:in_app_review/in_app_review.dart';
import 'package:zylag/core/data/local_data_source.dart';
import 'package:zylag/core/data/typedefs.dart';