asyncstate 0.0.1 asyncstate: ^0.0.1 copied to clipboard
A new Flutter package project.
Async State
Installing #
1. Depend on it #
Add this to your package's pubspec.yaml
file:
dependencies:
async_loader: ^0.0.1
2. Install it #
You can install packages from the command line:
with pub
:
$ pub get
with Flutter
:
$ flutter pub get
3. Import it #
Now in your Dart
code, you can use:
import 'package:asyncstate/asyncstate.dart;'
Usage #
AsyncStateClass
:
void main() {
AsyncStateClass.onInitAsyncState(
defaultDialogWidget:
const MyLoading(), //TODO Seta o Widget de loading inicial.
);
runApp(const MyApp());
}
Difine your Widget with Loading default.
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
themeMode: ThemeMode.dark,
navigatorObservers: [
AsyncStateClass.observer //TODO Here
],
theme: ThemeData.dark(),
home: HomePage(),
);
}
}
Add "AsyncStateClass.observer" on MaterialApp.
Bugs or Requests #
If you encounter any problems feel free to open an issue. If you feel the library is missing a feature, please raise a ticket on GitHub and I'll look into it. Pull request are also welcome.
Contributors #
Leonardo Serrano |
Marcus Brasizza |
If you like what I do, maybe consider buying me a coffee/tea π₯Ίππ