CAKE-329 | added unspent coins list page to the app

This commit is contained in:
OleksandrSobol
2021-05-25 20:32:36 +03:00
parent 5d780d5590
commit aca8e8a292
9 changed files with 220 additions and 17 deletions
@@ -0,0 +1,14 @@
class UnspentCoinsItem {
UnspentCoinsItem({
this.address,
this.amount,
this.isFrozen,
this.note,
this.isSending = true});
final String address;
final String amount;
final bool isFrozen;
final String note;
final bool isSending;
}
@@ -0,0 +1,47 @@
import 'package:cake_wallet/view_model/unspent_coins/unspent_coins_item.dart';
import 'package:mobx/mobx.dart';
part 'unspent_coins_list_view_model.g.dart';
const List<Map<String, dynamic>> unspentCoinsMap = [
<String, dynamic>{
"address" : "11111111111111121111132432432432432432432443124324324234324324324324332424",
"amount" : "222",
"isFrozen" : true,
"note" : "333cvgf23132132132132131321321314rwrtdggfdddewq ewqasfdxgdhgfgfszczcxgbhhhbcgbc"},
<String, dynamic>{
"address" : "444",
"amount" : "555",
"note" : "sfjskf"},
<String, dynamic>{
"address" : "777",
"amount" : "888",
"isFrozen" : false},
<String, dynamic>{
"address" : "11111111111111121111132432432432432432432443124324324234324324324324332424",
"amount" : "222",
"isFrozen" : true,
"note" : "333cvgf23132132132132131321321314rwrtdggfdddewq ewqasfdxgdhgfgfszczcxgbhhhbcgbc"},
<String, dynamic>{
"address" : "444",
"amount" : "555",
"note" : "sffsfsdsgs"},
<String, dynamic>{
"address" : "777",
"amount" : "888",
"isFrozen" : false},
<String, dynamic>{},
];
class UnspentCoinsListViewModel = UnspentCoinsListViewModelBase with _$UnspentCoinsListViewModel;
abstract class UnspentCoinsListViewModelBase with Store {
@computed
List<UnspentCoinsItem> get items => unspentCoinsMap.map((elem) =>
UnspentCoinsItem(
address: elem["address"] as String,
amount: elem["amount"] as String,
isFrozen: elem["isFrozen"] as bool,
note: elem["note"] as String
)).toList();
}