provider 1.2.0 copy "provider: ^1.2.0" to clipboard
provider: ^1.2.0 copied to clipboard

outdated

An helper to easily exposes a value using InheritedWidget without having to write one.

example/provider.dart

import 'package:flutter/widgets.dart';
import 'package:provider/provider.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Provider(
      value: 42,
      child: Example(),
    );
  }
}

class Example extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Text(Provider.of<int>(context).toString());
  }
}
10.5k
likes
0
points
3.6M
downloads

Publisher

verified publisherdash-overflow.net

Weekly Downloads

An helper to easily exposes a value using InheritedWidget without having to write one.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, flutter_hooks, functional_widget_annotation

More

Packages that depend on provider