This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //before | |
| Bind((i) => AppController(repository: i.get<MyRepository>(); | |
| //now | |
| Bind((i) => AppController(repository: i()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:flutter/material.dart'; | |
| void main() => runApp(MyApp()); | |
| class MyApp extends StatelessWidget { | |
| // This widget is the root of your application. | |
| @override | |
| Widget build(BuildContext context) { | |
| return MaterialApp( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class MyClass{ | |
| final int num; | |
| MyClass({this.num = 1}); | |
| } | |
| void main() { | |
| var myClass = MyClass(); | |
| print(myClass.num); //print 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: '3.6' | |
| services: | |
| postgres: | |
| image: postgis/postgis | |
| restart: always | |
| volumes: | |
| - db_data:/var/lib/postgresql/data | |
| environment: | |
| POSTGRES_PASSWORD: postgrespassword | |
| graphql-engine: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //configurações de classes | |
| GetIt.I.registerSingleton<RESTAPI>(RESTAPI()); | |
| //pegando a instância única da classe | |
| GetIt.I.get<RESTAPI>() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class MyCounter with ChangeNotifier { | |
| var counter = 0; | |
| increment() { | |
| counter++; | |
| changeNotify(); | |
| } | |
| } | |
| --------------- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| MultiProvider( | |
| providers: [ | |
| Provider<Something>(create: (_) => Something()), | |
| Provider<SomethingElse>(create: (_) => SomethingElse()), | |
| Provider<AnotherThing>(create: (_) => AnotherThing()), | |
| ], | |
| child: MaterialApp(), | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class MyBloc { | |
| static MyBloc instance = MyBloc(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:bloc_pattern/bloc_pattern.dart'; | |
| import 'package:flutter/material.dart'; | |
| import 'package:sa/src/screens/protections/pages/properties/properties_details/components/coverage_component.dart'; | |
| import 'package:sa/src/screens/protections/pages/properties/properties_details/property_details_bloc.dart'; | |
| import 'package:sa/src/shared/localization/app_localizations.dart'; | |
| import 'package:sa/src/shared/widgets/custom_tabbar/custom_tabbar_header.dart'; | |
| import 'package:sa/src/shared/widgets/custom_tabbar/custom_tabbar_widget.dart'; | |
| import 'package:sa/src/shared/widgets/sliver_persistent_header/sliver_persistent_header.dart'; | |
| import 'components/card_component.dart'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class HomeModule extends ModuleWidget { | |
| //Inject the blocs | |
| @override | |
| List<Bloc<BlocBase>> get blocs => [ | |
| Bloc((i) => HomeBloc())), | |
| ]; | |
| //Inject the dependencies | |
| @override |