Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
fluttertpc_get
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Grant Slender
2021-11-02 08:34:05 +1000
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
3d539880e04ec70b217018e2942f51fc6a386f8e
3d539880
1 parent
e7c29169
Fix to rx.trigger so that it checks for previous send to stream by set value
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
lib/get_rx/src/rx_types/rx_core/rx_impl.dart
lib/get_rx/src/rx_types/rx_core/rx_impl.dart
View file @
3d53988
...
...
@@ -67,6 +67,7 @@ mixin RxObjectMixin<T> on NotifyManager<T> {
}
bool
firstRebuild
=
true
;
bool
sentToStream
=
false
;
/// Same as `toString()` but using a getter.
String
get
string
=>
value
.
toString
();
...
...
@@ -96,10 +97,11 @@ mixin RxObjectMixin<T> on NotifyManager<T> {
/// Widget, only if it's different from the previous value.
set
value
(
T
val
)
{
if
(
subject
.
isClosed
)
return
;
sentToStream
=
false
;
if
(
_value
==
val
&&
!
firstRebuild
)
return
;
firstRebuild
=
false
;
_value
=
val
;
sentToStream
=
true
;
subject
.
add
(
_value
);
}
...
...
@@ -254,7 +256,7 @@ abstract class _RxImpl<T> extends RxNotifier<T> with RxObjectMixin<T> {
value
=
v
;
// If it's not the first rebuild, the listeners have been called already
// So we won't call them again.
if
(!
firstRebuild
)
{
if
(!
firstRebuild
&&
!
sentToStream
)
{
subject
.
add
(
v
);
}
}
...
...
Please
register
or
login
to post a comment