mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-12-25 12:59:24 +00:00
36 lines
773 B
Dart
36 lines
773 B
Dart
|
import 'package:flutter/foundation.dart';
|
||
|
import 'package:stackwallet/models/exchange/aggregate_currency.dart';
|
||
|
|
||
|
class ActivePair extends ChangeNotifier {
|
||
|
AggregateCurrency? _send;
|
||
|
AggregateCurrency? _receive;
|
||
|
|
||
|
AggregateCurrency? get send => _send;
|
||
|
AggregateCurrency? get receive => _receive;
|
||
|
|
||
|
void setSend(
|
||
|
AggregateCurrency? newSend, {
|
||
|
bool notifyListeners = false,
|
||
|
}) {
|
||
|
_send = newSend;
|
||
|
if (notifyListeners) {
|
||
|
this.notifyListeners();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
void setReceive(
|
||
|
AggregateCurrency? newReceive, {
|
||
|
bool notifyListeners = false,
|
||
|
}) {
|
||
|
_receive = newReceive;
|
||
|
if (notifyListeners) {
|
||
|
this.notifyListeners();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@override
|
||
|
String toString() {
|
||
|
return "ActivePair{ send: $send, receive: $receive }";
|
||
|
}
|
||
|
}
|