CWA-214 | applied new design to show keys page; moved standard list row to widgets directory

This commit is contained in:
Oleksandr Sobol 2020-05-19 17:50:58 +03:00
parent 8769e93025
commit ba9b19214c
4 changed files with 37 additions and 31 deletions

View file

@ -7,10 +7,11 @@ import 'package:cake_wallet/palette.dart';
import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/src/stores/wallet/wallet_keys_store.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/screens/base_page.dart';
import 'package:cake_wallet/src/widgets/standart_list_row.dart';
class ShowKeysPage extends BasePage { class ShowKeysPage extends BasePage {
@override @override
bool get isModalBackButton => true; Color get backgroundColor => PaletteDark.historyPanel;
@override @override
String get title => S.current.wallet_keys; String get title => S.current.wallet_keys;
@ -20,7 +21,8 @@ class ShowKeysPage extends BasePage {
final walletKeysStore = Provider.of<WalletKeysStore>(context); final walletKeysStore = Provider.of<WalletKeysStore>(context);
return Container( 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( child: Observer(
builder: (_) { builder: (_) {
final keysMap = { final keysMap = {
@ -31,22 +33,26 @@ class ShowKeysPage extends BasePage {
}; };
return ListView.separated( return ListView.separated(
separatorBuilder: (_, __) => Container( separatorBuilder: (context, index) => Container(
padding: EdgeInsets.only(left: 30.0, right: 20.0), height: 1,
child: Divider( padding: EdgeInsets.only(left: 24),
color: Theme.of(context).dividerTheme.color, color: PaletteDark.menuList,
height: 1.0)), child: Container(
height: 1,
color: PaletteDark.walletCardTopEndSync,
),
),
itemCount: keysMap.length, itemCount: keysMap.length,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
final key = keysMap.keys.elementAt(index); final key = keysMap.keys.elementAt(index);
final value = keysMap.values.elementAt(index); final value = keysMap.values.elementAt(index);
return ListTile( final isDrawTop = index == 0 ? true : false;
contentPadding: EdgeInsets.only( final isDrawBottom = index == keysMap.length - 1 ? true : false;
top: 10, bottom: 10, left: 30, right: 20),
return GestureDetector(
onTap: () { onTap: () {
Clipboard.setData(ClipboardData( Clipboard.setData(ClipboardData(text: value));
text: keysMap.values.elementAt(index)));
Scaffold.of(context).showSnackBar(SnackBar( Scaffold.of(context).showSnackBar(SnackBar(
content: Text( content: Text(
S.of(context).copied_key_to_clipboard(key), S.of(context).copied_key_to_clipboard(key),
@ -57,13 +63,13 @@ class ShowKeysPage extends BasePage {
duration: Duration(seconds: 1), duration: Duration(seconds: 1),
)); ));
}, },
title: Text(key + ':', style: TextStyle(fontSize: 16.0)), child: StandartListRow(
subtitle: Container( title: key + ':',
padding: EdgeInsets.only(top: 5.0), value: value,
child: Text(value, isDrawTop: isDrawTop,
style: TextStyle( isDrawBottom: isDrawBottom,
fontSize: 16.0, color: Palette.wildDarkBlue)), ),
)); );
}); });
}, },
)); ));

View file

@ -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/stores/settings/settings_store.dart';
import 'package:cake_wallet/src/screens/base_page.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_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'; import 'package:cake_wallet/palette.dart';
class TradeDetailsPage extends BasePage { class TradeDetailsPage extends BasePage {

View file

@ -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/domain/common/transaction_info.dart';
import 'package:cake_wallet/src/stores/settings/settings_store.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_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/src/screens/base_page.dart';
import 'package:cake_wallet/palette.dart'; import 'package:cake_wallet/palette.dart';