flutter_spyglass

Last updated:

0 purchases

flutter_spyglass Image
flutter_spyglass Images
Add to Cart

Description:

flutter spyglass

Spyglass for Flutter [WIP] #

Note: This package is in active development and its API might change
frequently. Currently it's basically functional but might contain frequent
bugs. It has not yet been thoroughly tested and is missing documentation and
examples.

Reliable service locator for all your Flutter needs.
Installation & usage #
Add the latest flutter_spyglass to your pubspec and you're ready to go!
flutter pub add flutter_spyglass
copied to clipboard
Basic usage:
// Wrap a widget in DepsProvider and read value from context.
// All dependencies in [DepsProvider.register] will be disposed of
// when DepsProvider is disposed
DepsProvider(
register: [
Dependency<Greeter>(
create: (deps) => Greeter(),
dispose: (greeter) => greeter.dispose(),
),
],
builder: (context, child) => Center(
child: Text(context.watch<Greeter>().message),
),
);
copied to clipboard
For more advanced usage of the Deps container/scope see docs for spyglass.

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.