working time
This commit is contained in:
parent
b0f075f2cb
commit
877b6cc393
11 changed files with 833 additions and 144 deletions
11
lib/controllers/time_controller.dart
Normal file
11
lib/controllers/time_controller.dart
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import "package:flutter_riverpod/flutter_riverpod.dart";
|
||||
|
||||
class TimeController extends StreamNotifier<DateTime> {
|
||||
@override
|
||||
Stream<DateTime> build() =>
|
||||
Stream.periodic(Duration(seconds: 1), (_) => DateTime.now());
|
||||
|
||||
static final provider = StreamNotifierProvider<TimeController, DateTime>(
|
||||
TimeController.new,
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue