future_manager 0.0.1 copy "future_manager: ^0.0.1" to clipboard
future_manager: ^0.0.1 copied to clipboard

ValueNotifier and ValueListenableBuilder but for asynchronous value.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:future_manager/future_manager.dart';
import 'package:sura_flutter/sura_flutter.dart';

import 'src/home.dart';

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

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

  @override
  Widget build(BuildContext context) {
    return FutureManagerProvider(
      errorBuilder: (error, onRefresh) {
        return Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              Text(error.toString()),
              SuraAsyncButton(
                fullWidth: false,
                onPressed: onRefresh,
                child: const Icon(Icons.refresh),
              ),
              // AnimatedBuilder(animation: animation, builder: builder)
            ],
          ),
        );
      },
      child: MaterialApp(
        title: 'Future Manager Example',
        theme: ThemeData(
          primarySwatch: Colors.blue,
        ),
        home: MyHomePage(
          dataManager: () => FutureManager(
            reloading: true,
            cacheOption: const ManagerCacheOption.non(),
          ),
        ),
      ),
    );
  }
}
10
likes
150
points
572
downloads

Publisher

verified publisherlynical.com

Weekly Downloads

ValueNotifier and ValueListenableBuilder but for asynchronous value.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on future_manager