From d51d0cc076c6fb263b56b518e2fd0c6bbbe94ad0 Mon Sep 17 00:00:00 2001 From: Luis Henrique Manosso Von Mecheln Date: Sat, 22 Apr 2023 22:46:23 -0300 Subject: [PATCH] update dependencies --- example/lib/app/app_widget.dart | 4 +- example/lib/app/modules/home/home_module.dart | 18 ++++----- example/lib/app/modules/home/home_page.dart | 10 ++--- example/lib/app/modules/home/home_store.dart | 4 +- example/lib/main.dart | 3 +- example/pubspec.yaml | 12 +++--- .../presentation/templates/start.dart | 39 ++++++++++--------- pubspec.yaml | 10 ++--- 8 files changed, 53 insertions(+), 47 deletions(-) diff --git a/example/lib/app/app_widget.dart b/example/lib/app/app_widget.dart index 3741f47..b2106cb 100644 --- a/example/lib/app/app_widget.dart +++ b/example/lib/app/app_widget.dart @@ -2,6 +2,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_modular/flutter_modular.dart'; class AppWidget extends StatelessWidget { + const AppWidget({Key? key}) : super(key: key); + @override Widget build(BuildContext context) { return MaterialApp.router( @@ -11,4 +13,4 @@ class AppWidget extends StatelessWidget { routeInformationParser: Modular.routeInformationParser, ); } -} \ No newline at end of file +} diff --git a/example/lib/app/modules/home/home_module.dart b/example/lib/app/modules/home/home_module.dart index ac04aac..45f3fc3 100644 --- a/example/lib/app/modules/home/home_module.dart +++ b/example/lib/app/modules/home/home_module.dart @@ -1,16 +1,16 @@ import 'package:flutter_modular/flutter_modular.dart'; -import 'home_store.dart'; +import 'home_store.dart'; import 'home_page.dart'; - + class HomeModule extends Module { @override final List binds = [ - Bind.lazySingleton((i) => HomeStore()), - ]; + Bind.lazySingleton((i) => HomeStore()), + ]; - @override - final List routes = [ - ChildRoute(Modular.initialRoute, child: (_, args) => HomePage()), - ]; -} \ No newline at end of file + @override + final List routes = [ + ChildRoute(Modular.initialRoute, child: (_, args) => const HomePage()), + ]; +} diff --git a/example/lib/app/modules/home/home_page.dart b/example/lib/app/modules/home/home_page.dart index e71f842..1564ddf 100644 --- a/example/lib/app/modules/home/home_page.dart +++ b/example/lib/app/modules/home/home_page.dart @@ -8,11 +8,10 @@ class HomePage extends StatefulWidget { const HomePage({Key? key, this.title = 'Home'}) : super(key: key); @override - _HomePageState createState() => _HomePageState(); + State createState() => _HomePageState(); } class _HomePageState extends State { - late final HomeStore store; @override @@ -25,14 +24,15 @@ class _HomePageState extends State { void dispose() { Modular.dispose(); super.dispose(); - } + } + @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text('Counter'), ), - body: ScopedBuilder( + body: ScopedBuilder( store: store, onState: (_, counter) { return Padding( @@ -55,4 +55,4 @@ class _HomePageState extends State { ), ); } -} \ No newline at end of file +} diff --git a/example/lib/app/modules/home/home_store.dart b/example/lib/app/modules/home/home_store.dart index 77a4d81..090d608 100644 --- a/example/lib/app/modules/home/home_store.dart +++ b/example/lib/app/modules/home/home_store.dart @@ -1,6 +1,6 @@ import 'package:flutter_triple/flutter_triple.dart'; -class HomeStore extends NotifierStore { +class HomeStore extends Store { HomeStore() : super(0); Future increment() async { @@ -17,4 +17,4 @@ class HomeStore extends NotifierStore { setLoading(false); } -} \ No newline at end of file +} diff --git a/example/lib/main.dart b/example/lib/main.dart index 91ba071..037b98d 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -4,4 +4,5 @@ import 'package:flutter_modular/flutter_modular.dart'; import 'app/app_module.dart'; import 'app/app_widget.dart'; -void main() => runApp(ModularApp(module: AppModule(), child: AppWidget())); \ No newline at end of file +void main() => + runApp(ModularApp(module: AppModule(), child: const AppWidget())); diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 53c0fa8..bf023fb 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -6,24 +6,24 @@ environment: sdk: ">=2.12.0 <3.0.0" dependencies: flutter_modular: ^5.0.3 - flutter_triple: ^1.2.7+4 + flutter_triple: ^2.0.1 flutter: sdk: flutter cupertino_icons: ^1.0.2 - rx_notifier: ^1.1.0 + rx_notifier: ^2.2.2 mobx: ^2.0.7 flutter_mobx: ^2.0.5 - flutter_bloc: 8.0.1 + flutter_bloc: ^8.1.2 rxdart: ^0.27.3 - triple: ^1.5.0+1 + triple: ^2.0.1 dev_dependencies: modular_test: ^2.0.0 flutter_test: sdk: flutter - triple_test: ^1.0.0+1 + triple_test: ^2.0.0 mobx_codegen: ^2.0.6 - bloc_test: 9.0.3 + bloc_test: ^9.1.1 flutter: uses-material-design: true scripts: diff --git a/lib/src/modules/template_generator/presentation/templates/start.dart b/lib/src/modules/template_generator/presentation/templates/start.dart index 94fc006..4207c3d 100644 --- a/lib/src/modules/template_generator/presentation/templates/start.dart +++ b/lib/src/modules/template_generator/presentation/templates/start.dart @@ -8,7 +8,7 @@ main: | import 'app/app_module.dart'; import 'app/app_widget.dart'; - void main() => runApp(ModularApp(module: AppModule(), child: AppWidget())); + void main() => runApp(ModularApp(module: AppModule(), child: const AppWidget())); app_module: | import 'package:flutter_modular/flutter_modular.dart'; @@ -31,7 +31,9 @@ app_widget: | import 'package:flutter_modular/flutter_modular.dart'; class AppWidget extends StatelessWidget { - @override + const AppWidget({Key? key}) : super(key: key); + + @override Widget build(BuildContext context) { return MaterialApp.router( title: 'Flutter Slidy', @@ -50,7 +52,7 @@ home_page: | const HomePage({Key? key, this.title = 'Home'}) : super(key: key); @override - _HomePageState createState() => _HomePageState(); + State createState() => _HomePageState(); } class _HomePageState extends State { @@ -78,7 +80,7 @@ home_module: | @override final List routes = [ - ChildRoute(Modular.initialRoute, child: (_, args) => HomePage()), + ChildRoute(Modular.initialRoute, child: (_, args) => const HomePage()), ]; } @@ -150,10 +152,11 @@ home_page_cubit: | class HomePage extends StatefulWidget { @override - _HomePageState createState() => _HomePageState(); + State createState() => _HomePageState(); } class _HomePageState extends State { + final CounterCubit _counterCubit = Modular.get(); @override @@ -245,13 +248,13 @@ rx_dart: | triple: | import 'package:flutter_triple/flutter_triple.dart'; - class HomeStore extends NotifierStore { + class HomeStore extends Store { HomeStore() : super(0); Future increment() async { setLoading(true); - await Future.delayed(Duration(seconds: 1)); + await Future.delayed(const Duration(seconds: 1)); int value = state + 1; if (value < 5) { @@ -275,7 +278,7 @@ home_page_triple: | const HomePage({Key? key, this.title = 'Home'}) : super(key: key); @override - _HomePageState createState() => _HomePageState(); + State createState() => _HomePageState(); } class _HomePageState extends State { @@ -297,17 +300,17 @@ home_page_triple: | Widget build(BuildContext context) { return Scaffold( appBar: AppBar( - title: Text('Counter'), + title: const Text('Counter'), ), - body: ScopedBuilder( + body: ScopedBuilder( store: store, onState: (_, counter) { return Padding( - padding: EdgeInsets.all(10), + padding: const EdgeInsets.all(10), child: Text('\$counter'), ); }, - onError: (context, error) => Center( + onError: (context, error) => const Center( child: Text( 'Too many clicks', style: TextStyle(color: Colors.red), @@ -318,7 +321,7 @@ home_page_triple: | onPressed: () { store.increment(); }, - child: Icon(Icons.add), + child: const Icon(Icons.add), ), ); } @@ -338,7 +341,7 @@ home_module_triple: | @override final List routes = [ - ChildRoute(Modular.initialRoute, child: (_, args) => HomePage()), + ChildRoute(Modular.initialRoute, child: (_, args) => const HomePage()), ]; } @@ -353,7 +356,7 @@ home_page_mobx: | const HomePage({Key? key, this.title = 'Home'}) : super(key: key); @override - _HomePageState createState() => _HomePageState(); + State createState() => _HomePageState(); } class _HomePageState extends State { @@ -399,7 +402,7 @@ home_module_mobx: | @override final List routes = [ - ChildRoute(Modular.initialRoute, child: (_, args) => HomePage()), + ChildRoute(Modular.initialRoute, child: (_, args) => const HomePage()), ]; } @@ -413,7 +416,7 @@ home_page_rx_dart: | const HomePage({Key? key, this.title = 'Home'}) : super(key: key); @override - _HomePageState createState() => _HomePageState(); + State createState() => _HomePageState(); } class _HomePageState extends State { @@ -460,7 +463,7 @@ home_module_rx_dart: | @override final List routes = [ - ChildRoute(Modular.initialRoute, child: (_, args) => HomePage()), + ChildRoute(Modular.initialRoute, child: (_, args) => const HomePage()), ]; } '''; diff --git a/pubspec.yaml b/pubspec.yaml index 5c31c6d..e9421e3 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -18,19 +18,19 @@ dependencies: collection: ^1.14.11 meta: ^1.1.8 source_span: ^1.7.0 - fhir_yaml: ^0.4.0 - rxdart: ^0.26.0 + fhir_yaml: ^0.9.0 + rxdart: ^0.27.7 io: ^1.0.0 - fpdart: ^0.2.0 + fpdart: ^0.5.0 pub_api_client: ^2.2.1 modular_core: ^2.0.3+1 dev_dependencies: - build_runner: ^2.0.1 + build_runner: ^2.3.3 build_version: ^2.0.3 test: ^1.16.0-nullsafety.17 - mocktail: ^0.1.1 + mocktail: ^0.3.0 build_test: ^2.1.0 cli_pkg: ^2.1.4 grinder: ^0.9.2