asyncstate 2.0.2 copy "asyncstate: ^2.0.2" to clipboard
asyncstate: ^2.0.2 copied to clipboard

outdated

This package will help you to call a loading in your async methods very easily, and you don't need to worried when it's is starting or finishing.

example/lib/main.dart

import 'package:asyncstate/widget/async_state_builder.dart';
import 'package:flutter/material.dart';

import 'components/my_loading.dart';
import 'home/home_page.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    /// Here you need to wrap your MaterialApp with the AsyncStateBuilder
    return AsyncStateBuilder(
      /// Here you can customize your default loading that will show every transaction
      /// Leave it and it will show a simple CircularProgress.adaptive indicator
      customLoader: const MyLoading(),

      builder: (navigatorObserver) => MaterialApp(
        themeMode: ThemeMode.dark,

        /// Here you need to pass the navigatorObserver to the MaterialApp
        navigatorObservers: [navigatorObserver],
        home: HomePage(),
      ),
    );
  }
}
56
likes
0
points
211
downloads

Publisher

verified publisherleonardoserrano.dev

Weekly Downloads

This package will help you to call a loading in your async methods very easily, and you don't need to worried when it's is starting or finishing.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on asyncstate