mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-23 03:59:23 +00:00
CWA-214 | applied new design to show keys page; moved standard list row to widgets directory
This commit is contained in:
parent
8769e93025
commit
ba9b19214c
4 changed files with 37 additions and 31 deletions
|
@ -7,10 +7,11 @@ import 'package:cake_wallet/palette.dart';
|
|||
import 'package:cake_wallet/generated/i18n.dart';
|
||||
import 'package:cake_wallet/src/stores/wallet/wallet_keys_store.dart';
|
||||
import 'package:cake_wallet/src/screens/base_page.dart';
|
||||
import 'package:cake_wallet/src/widgets/standart_list_row.dart';
|
||||
|
||||
class ShowKeysPage extends BasePage {
|
||||
@override
|
||||
bool get isModalBackButton => true;
|
||||
Color get backgroundColor => PaletteDark.historyPanel;
|
||||
|
||||
@override
|
||||
String get title => S.current.wallet_keys;
|
||||
|
@ -20,7 +21,8 @@ class ShowKeysPage extends BasePage {
|
|||
final walletKeysStore = Provider.of<WalletKeysStore>(context);
|
||||
|
||||
return Container(
|
||||
padding: EdgeInsets.only(top: 20.0, bottom: 20.0, left: 20, right: 20),
|
||||
color: PaletteDark.historyPanel,
|
||||
padding: EdgeInsets.only(top: 20.0, bottom: 20.0),
|
||||
child: Observer(
|
||||
builder: (_) {
|
||||
final keysMap = {
|
||||
|
@ -31,39 +33,43 @@ class ShowKeysPage extends BasePage {
|
|||
};
|
||||
|
||||
return ListView.separated(
|
||||
separatorBuilder: (_, __) => Container(
|
||||
padding: EdgeInsets.only(left: 30.0, right: 20.0),
|
||||
child: Divider(
|
||||
color: Theme.of(context).dividerTheme.color,
|
||||
height: 1.0)),
|
||||
separatorBuilder: (context, index) => Container(
|
||||
height: 1,
|
||||
padding: EdgeInsets.only(left: 24),
|
||||
color: PaletteDark.menuList,
|
||||
child: Container(
|
||||
height: 1,
|
||||
color: PaletteDark.walletCardTopEndSync,
|
||||
),
|
||||
),
|
||||
itemCount: keysMap.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
final key = keysMap.keys.elementAt(index);
|
||||
final value = keysMap.values.elementAt(index);
|
||||
|
||||
return ListTile(
|
||||
contentPadding: EdgeInsets.only(
|
||||
top: 10, bottom: 10, left: 30, right: 20),
|
||||
onTap: () {
|
||||
Clipboard.setData(ClipboardData(
|
||||
text: keysMap.values.elementAt(index)));
|
||||
Scaffold.of(context).showSnackBar(SnackBar(
|
||||
content: Text(
|
||||
S.of(context).copied_key_to_clipboard(key),
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
backgroundColor: Colors.green,
|
||||
duration: Duration(seconds: 1),
|
||||
));
|
||||
},
|
||||
title: Text(key + ':', style: TextStyle(fontSize: 16.0)),
|
||||
subtitle: Container(
|
||||
padding: EdgeInsets.only(top: 5.0),
|
||||
child: Text(value,
|
||||
style: TextStyle(
|
||||
fontSize: 16.0, color: Palette.wildDarkBlue)),
|
||||
final isDrawTop = index == 0 ? true : false;
|
||||
final isDrawBottom = index == keysMap.length - 1 ? true : false;
|
||||
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
Clipboard.setData(ClipboardData(text: value));
|
||||
Scaffold.of(context).showSnackBar(SnackBar(
|
||||
content: Text(
|
||||
S.of(context).copied_key_to_clipboard(key),
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
backgroundColor: Colors.green,
|
||||
duration: Duration(seconds: 1),
|
||||
));
|
||||
},
|
||||
child: StandartListRow(
|
||||
title: key + ':',
|
||||
value: value,
|
||||
isDrawTop: isDrawTop,
|
||||
isDrawBottom: isDrawBottom,
|
||||
),
|
||||
);
|
||||
});
|
||||
},
|
||||
));
|
||||
|
|
|
@ -8,7 +8,7 @@ import 'package:cake_wallet/src/stores/exchange_trade/exchange_trade_store.dart'
|
|||
import 'package:cake_wallet/src/stores/settings/settings_store.dart';
|
||||
import 'package:cake_wallet/src/screens/base_page.dart';
|
||||
import 'package:cake_wallet/src/screens/transaction_details/standart_list_item.dart';
|
||||
import 'package:cake_wallet/src/screens/transaction_details/standart_list_row.dart';
|
||||
import 'package:cake_wallet/src/widgets/standart_list_row.dart';
|
||||
import 'package:cake_wallet/palette.dart';
|
||||
|
||||
class TradeDetailsPage extends BasePage {
|
||||
|
|
|
@ -6,7 +6,7 @@ import 'package:cake_wallet/generated/i18n.dart';
|
|||
import 'package:cake_wallet/src/domain/common/transaction_info.dart';
|
||||
import 'package:cake_wallet/src/stores/settings/settings_store.dart';
|
||||
import 'package:cake_wallet/src/screens/transaction_details/standart_list_item.dart';
|
||||
import 'package:cake_wallet/src/screens/transaction_details/standart_list_row.dart';
|
||||
import 'package:cake_wallet/src/widgets/standart_list_row.dart';
|
||||
import 'package:cake_wallet/src/screens/base_page.dart';
|
||||
import 'package:cake_wallet/palette.dart';
|
||||
|
||||
|
|
Loading…
Reference in a new issue