mirror of
https://github.com/rrousselGit/riverpod.git
synced 2025-08-15 10:11:27 +08:00
14 lines
425 B
Dart
14 lines
425 B
Dart
// ignore_for_file: omit_local_variable_types
|
|
|
|
import 'package:flutter/widgets.dart';
|
|
import 'package:flutter_riverpod/legacy.dart';
|
|
|
|
/* SNIPPET START */
|
|
final myProvider = ChangeNotifierProvider<ValueNotifier<int>>((ref) {
|
|
// {@template provider}
|
|
// Will listen to and dispose of the ValueNotifier.
|
|
// Widgets can then "ref.watch" this provider to listen to updates.
|
|
// {@endtemplate}
|
|
return ValueNotifier(0);
|
|
});
|