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
Eduardo Florence
2021-04-05 16:27:56 -0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
275b5c37948f4c92ac6f48acfe90363b4e8a3e2f
275b5c37
1 parent
039a9e73
RxInt and RxnInt: adjust operator + and -
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
22 deletions
lib/get_rx/src/rx_types/rx_core/rx_num.dart
lib/get_rx/src/rx_types/rx_core/rx_num.dart
View file @
275b5c3
...
...
@@ -848,25 +848,41 @@ class RxnDouble extends Rx<double?> {
class
RxInt
extends
Rx
<
int
>
{
RxInt
(
int
initial
)
:
super
(
initial
);
/// Addition operator.
RxInt
operator
+(
int
other
)
{
value
=
value
+
other
;
return
this
;
}
/// Subtraction operator.
RxInt
operator
-(
int
other
)
{
value
=
value
-
other
;
return
this
;
}
}
class
RxnInt
extends
Rx
<
int
?>
{
RxnInt
([
int
?
initial
])
:
super
(
initial
);
}
extension
RxIntExt
on
Rx
<
int
>
{
/// Addition operator.
Rx
<
int
>
operator
+(
int
other
)
{
value
=
value
+
other
;
RxnInt
operator
+(
int
other
)
{
if
(
value
!=
null
)
{
value
=
value
!
+
other
;
}
return
this
;
}
/// Subtraction operator.
Rx
<
int
>
operator
-(
int
other
)
{
value
=
value
-
other
;
RxnInt
operator
-(
int
other
)
{
if
(
value
!=
null
)
{
value
=
value
!
-
other
;
}
return
this
;
}
}
extension
RxIntExt
on
Rx
<
int
>
{
/// Bit-wise and operator.
///
/// Treating both `this` and [other] as sufficiently large two's component
...
...
@@ -1076,22 +1092,6 @@ extension RxIntExt on Rx<int> {
}
extension
RxnIntExt
on
Rx
<
int
?>
{
/// Addition operator.
Rx
<
int
?>?
operator
+(
int
other
)
{
if
(
value
!=
null
)
{
value
=
value
!
+
other
;
return
this
;
}
}
/// Subtraction operator.
Rx
<
int
?>?
operator
-(
int
other
)
{
if
(
value
!=
null
)
{
value
=
value
!
-
other
;
return
this
;
}
}
/// Bit-wise and operator.
///
/// Treating both `this` and [other] as sufficiently large two's component
...
...
Please
register
or
login
to post a comment