mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-18 05:51:34 +02:00
Merge pull request #144 from cake-tech/CAKE-158-transaction-and-balance-displaying-between-accounts
CAKE-158 | added calculating balance to _onAccountChangeReaction in t…
This commit is contained in:
@@ -5,6 +5,7 @@ import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart';
|
||||
import 'package:cake_wallet/entities/wallet_type.dart';
|
||||
import 'package:cake_wallet/src/screens/dashboard/wallet_menu.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
import 'package:flutter_mobx/flutter_mobx.dart';
|
||||
|
||||
// FIXME: terrible design.
|
||||
|
||||
@@ -147,7 +148,7 @@ class MenuWidgetState extends State<MenuWidget> {
|
||||
),
|
||||
if (widget.dashboardViewModel.subname !=
|
||||
null)
|
||||
Text(
|
||||
Observer(builder: (_) => Text(
|
||||
widget.dashboardViewModel.subname,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context)
|
||||
@@ -156,7 +157,7 @@ class MenuWidgetState extends State<MenuWidget> {
|
||||
.decorationColor,
|
||||
fontWeight: FontWeight.w500,
|
||||
fontSize: 12),
|
||||
)
|
||||
))
|
||||
],
|
||||
),
|
||||
))
|
||||
|
||||
@@ -103,7 +103,12 @@ class MoneroAccountListPage extends StatelessWidget {
|
||||
accountListViewModel
|
||||
.select(account);
|
||||
Navigator.of(context).pop();
|
||||
});
|
||||
},
|
||||
onEdit: () async =>
|
||||
await Navigator.of(context)
|
||||
.pushNamed(
|
||||
Routes.accountCreation,
|
||||
arguments: account));
|
||||
},
|
||||
),
|
||||
isAlwaysShowScrollThumb
|
||||
|
||||
@@ -1,15 +1,19 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_slidable/flutter_slidable.dart';
|
||||
import 'package:cake_wallet/generated/i18n.dart';
|
||||
|
||||
class AccountTile extends StatelessWidget {
|
||||
AccountTile({
|
||||
@required this.isCurrent,
|
||||
@required this.accountName,
|
||||
@required this.onTap
|
||||
@required this.onTap,
|
||||
@required this.onEdit
|
||||
});
|
||||
|
||||
final bool isCurrent;
|
||||
final String accountName;
|
||||
final VoidCallback onTap;
|
||||
final Function() onTap;
|
||||
final Function() onEdit;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -20,7 +24,7 @@ class AccountTile extends StatelessWidget {
|
||||
? Theme.of(context).textTheme.subtitle.color
|
||||
: Theme.of(context).textTheme.display4.color;
|
||||
|
||||
return GestureDetector(
|
||||
final Widget cell = GestureDetector(
|
||||
onTap: onTap,
|
||||
child: Container(
|
||||
height: 77,
|
||||
@@ -39,5 +43,17 @@ class AccountTile extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
return isCurrent ? cell : Slidable(
|
||||
key: Key(accountName),
|
||||
child: cell,
|
||||
actionPane: SlidableDrawerActionPane(),
|
||||
secondaryActions: <Widget>[
|
||||
IconSlideAction(
|
||||
caption: S.of(context).edit,
|
||||
color: Colors.blue,
|
||||
icon: Icons.edit,
|
||||
onTap: () => onEdit?.call())
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -117,7 +117,7 @@ class ReceivePage extends BasePage {
|
||||
Icons.arrow_forward_ios,
|
||||
size: 14,
|
||||
color:
|
||||
Theme.of(context).textTheme.display1.color,
|
||||
Theme.of(context).textTheme.display1.color,
|
||||
));
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ class ReceivePage extends BasePage {
|
||||
Icons.add,
|
||||
size: 20,
|
||||
color:
|
||||
Theme.of(context).textTheme.display1.color,
|
||||
Theme.of(context).textTheme.display1.color,
|
||||
));
|
||||
}
|
||||
|
||||
@@ -140,13 +140,13 @@ class ReceivePage extends BasePage {
|
||||
addressListViewModel.address.address;
|
||||
final backgroundColor = isCurrent
|
||||
? Theme.of(context)
|
||||
.textTheme
|
||||
.display3
|
||||
.decorationColor
|
||||
.textTheme
|
||||
.display3
|
||||
.decorationColor
|
||||
: Theme.of(context)
|
||||
.textTheme
|
||||
.display2
|
||||
.decorationColor;
|
||||
.textTheme
|
||||
.display2
|
||||
.decorationColor;
|
||||
final textColor = isCurrent
|
||||
? Theme.of(context).textTheme.display3.color
|
||||
: Theme.of(context).textTheme.display2.color;
|
||||
@@ -155,8 +155,7 @@ class ReceivePage extends BasePage {
|
||||
isCurrent: isCurrent,
|
||||
backgroundColor: backgroundColor,
|
||||
textColor: textColor,
|
||||
onTap: (_) =>
|
||||
addressListViewModel.setAddress(item),
|
||||
onTap: (_) => addressListViewModel.setAddress(item),
|
||||
onEdit: () => Navigator.of(context).pushNamed(
|
||||
Routes.newSubaddress,
|
||||
arguments: item));
|
||||
@@ -166,11 +165,11 @@ class ReceivePage extends BasePage {
|
||||
return index != 0
|
||||
? cell
|
||||
: ClipRRect(
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(30),
|
||||
topRight: Radius.circular(30)),
|
||||
child: cell,
|
||||
);
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(30),
|
||||
topRight: Radius.circular(30)),
|
||||
child: cell,
|
||||
);
|
||||
})),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -14,6 +14,7 @@ class AddressCell extends StatelessWidget {
|
||||
address: item.address,
|
||||
name: item.name,
|
||||
isCurrent: isCurrent,
|
||||
isPrimary: item.isPrimary,
|
||||
backgroundColor: backgroundColor,
|
||||
textColor: textColor,
|
||||
onTap: onTap,
|
||||
@@ -23,6 +24,7 @@ class AddressCell extends StatelessWidget {
|
||||
{@required this.address,
|
||||
@required this.name,
|
||||
@required this.isCurrent,
|
||||
@required this.isPrimary,
|
||||
@required this.backgroundColor,
|
||||
@required this.textColor,
|
||||
this.onTap,
|
||||
@@ -31,6 +33,7 @@ class AddressCell extends StatelessWidget {
|
||||
final String address;
|
||||
final String name;
|
||||
final bool isCurrent;
|
||||
final bool isPrimary;
|
||||
final Color backgroundColor;
|
||||
final Color textColor;
|
||||
final Function(String) onTap;
|
||||
@@ -56,7 +59,7 @@ class AddressCell extends StatelessWidget {
|
||||
),
|
||||
));
|
||||
|
||||
return isCurrent
|
||||
return (isCurrent || isPrimary)
|
||||
? cell
|
||||
: Slidable(
|
||||
key: Key(address),
|
||||
|
||||
Reference in New Issue
Block a user