scoped 0.0.3 copy "scoped: ^0.0.3" to clipboard
scoped: ^0.0.3 copied to clipboard

outdated

dependency injection with scoped store

scoped #

Flutter dependency injection with a scoped store

Example

lib\main.dart

import 'package:di/di.dart';
//...

void main() => runApp(Scope(
  store:Store()
    ..add(Service('a great service')),
  child: YourApp()));

class Service {
  final String name;
  Service(this.name);
}

class YourApp extends StatelessWidget {
  Wiget build(BuildingContext context){
    return Text(Scope.get<Service>().name);
  }
}
6
likes
0
pub points
42%
popularity

Publisher

verified publisherswipelab.co

dependency injection with scoped store

Repository
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on scoped