generated from glemartret/lm_labs_app
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2750a88
commit ae1c0c1
Showing
8 changed files
with
536 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// import 'package:pos/src/utils/bubbling_event/bubbling_state.dart'; | ||
// import 'package:riverpod_annotation/riverpod_annotation.dart'; | ||
|
||
// part 'bubbling_event.g.dart'; | ||
|
||
// TODO: Wait for riverpod v3 to be released for generic types support | ||
// @riverpod | ||
// class BubblingStream<T> extends _$BubblingStream { | ||
// void addListener(BubblingListener<T> listener) { | ||
// final listeners = state.listeners; | ||
// listeners.add(listener); | ||
// state = state.copyWith(listeners: listeners); | ||
// } | ||
|
||
// @override | ||
// BubblingState<T> build(Stream<T> stream) => | ||
// BubblingState<T>(stream: stream..listen(_internalListener)); | ||
|
||
// void removeListener(BubblingListener<T> listener) { | ||
// final listeners = state.listeners; | ||
// listeners.remove(listener); | ||
// state = state.copyWith(listeners: listeners); | ||
// } | ||
|
||
// void _internalListener(T value) { | ||
// for (final listener in state.listeners) { | ||
// if (listener(value)) { | ||
// break; | ||
// } | ||
// } | ||
// } | ||
// } |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// import 'package:freezed_annotation/freezed_annotation.dart'; | ||
|
||
// part 'bubbling_state.freezed.dart'; | ||
|
||
// typedef BubblingListener<T> = bool Function(T value); | ||
|
||
// @freezed | ||
// sealed class BubblingState<T> { | ||
// const factory BubblingState({ | ||
// required Stream<T> stream, | ||
// @Default([]) List<BubblingListener<T>> listeners, | ||
// }) = _BubblingState; | ||
// } |
Oops, something went wrong.