deferred_type_flutter

Last updated:

0 purchases

deferred_type_flutter Image
deferred_type_flutter Images
Add to Cart

Description:

deferred type flutter

deferred_type_flutter for Dart #


Packages for Flutter based on the library deferred_type.
FutureBuilder2 #
FutureBuilder2, an alternative "FutureBuilder" which is simpler to use than the bundled one provided by default in Flutter.
import "package:deferred_type/deferred_type.dart";

final futureBuilder = FutureBuilder2<String>(
future: someFuture,
builder: (context, state) => state.maybeWhen<Widget>(
inProgress: () => const CircularProgressIndicator(),
success: (data) => SomeWidget(data),
error: (error, _stacktrace) => SomeErrorWidget(error),
// handle fallback cases, must be provided
// if all states are not handled.
orElse: () => const FallbackWidget(),
);
);
copied to clipboard
API Reference #
Detailed API documentation can be found on pub.dev.
Possible to-do #

Come up with a better name for the FutureBuilder.

License #
This project is MIT licensed.

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.