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

outdated

simple dependency injection using a root scope inherited widget and a store factory

scoped #

A simple scoped store allowing for quick access to global services/bloc's

Example

pubspec.yaml

dependencies:
  scoped: ^0.1.0

lib\main.dart

import 'package:scoped/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>(context).name);
  }
}
6
likes
0
pub points
43%
popularity

Publisher

verified publisherswipelab.co

simple dependency injection using a root scope inherited widget and a store factory

Repository
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on scoped