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
Jonatas
2020-09-16 09:50:36 -0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
67fb2a7a0ebe3baf2b2ae5430784f33d718bd9ce
67fb2a7a
1 parent
d837002b
mod operator + and -
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
7 deletions
lib/src/state_manager/rx/rx_core/rx_num.dart
lib/src/state_manager/rx/rx_core/rx_num.dart
View file @
67fb2a7
...
...
@@ -3,10 +3,6 @@ part of 'rx_impl.dart';
/// Base Rx class for all num Rx's.
class
_BaseRxNum
<
T
extends
num
>
extends
_RxImpl
<
T
>
{
/// Addition operator. */
num
operator
+(
num
other
)
=>
value
+
other
;
/// Subtraction operator.
num
operator
-(
num
other
)
=>
value
-
other
;
/// Multiplication operator.
num
operator
*(
num
other
)
=>
value
*
other
;
...
...
@@ -270,7 +266,18 @@ class _BaseRxNum<T extends num> extends _RxImpl<T> {
value
.
toStringAsPrecision
(
precision
);
}
class
RxNum
extends
_BaseRxNum
<
num
>
{}
class
RxNum
extends
_BaseRxNum
<
num
>
{
num
operator
+(
num
other
)
{
value
+=
other
;
return
value
;
}
/// Subtraction operator.
num
operator
-(
num
other
)
{
value
-=
other
;
return
value
;
}
}
class
RxDouble
extends
_BaseRxNum
<
double
>
{
RxDouble
([
double
initial
])
{
...
...
@@ -278,10 +285,16 @@ class RxDouble extends _BaseRxNum<double> {
}
/// Addition operator.
double
operator
+(
num
other
)
=>
value
+
other
;
RxDouble
operator
+(
num
other
)
{
value
+=
other
;
return
this
;
}
/// Subtraction operator.
double
operator
-(
num
other
)
=>
value
-
other
;
RxDouble
operator
-(
num
other
)
{
value
-=
other
;
return
this
;
}
/// Multiplication operator.
double
operator
*(
num
other
)
=>
value
*
other
;
...
...
@@ -383,6 +396,18 @@ class RxInt extends _BaseRxNum<int> {
value
=
initial
;
}
/// Addition operator.
RxInt
operator
+(
int
other
)
{
value
+=
other
;
return
this
;
}
/// Subtraction operator.
RxInt
operator
-(
int
other
)
{
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