mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-03-21 22:58:49 +00:00
token view ui tweak
This commit is contained in:
parent
c51ef8ee26
commit
0527497ce6
2 changed files with 69 additions and 46 deletions
|
@ -5,6 +5,7 @@ import 'package:stackwallet/pages/token_view/token_view.dart';
|
||||||
import 'package:stackwallet/providers/global/wallets_provider.dart';
|
import 'package:stackwallet/providers/global/wallets_provider.dart';
|
||||||
import 'package:stackwallet/utilities/assets.dart';
|
import 'package:stackwallet/utilities/assets.dart';
|
||||||
import 'package:stackwallet/utilities/constants.dart';
|
import 'package:stackwallet/utilities/constants.dart';
|
||||||
|
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||||
import 'package:stackwallet/utilities/text_styles.dart';
|
import 'package:stackwallet/utilities/text_styles.dart';
|
||||||
import 'package:stackwallet/utilities/theme/stack_colors.dart';
|
import 'package:stackwallet/utilities/theme/stack_colors.dart';
|
||||||
import 'package:stackwallet/widgets/rounded_container.dart';
|
import 'package:stackwallet/widgets/rounded_container.dart';
|
||||||
|
@ -57,10 +58,31 @@ class TokenSummary extends ConsumerWidget {
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 6,
|
height: 6,
|
||||||
),
|
),
|
||||||
Text(
|
Row(
|
||||||
"${balance.getTotal()}"
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
" ${token.symbol}",
|
children: [
|
||||||
style: STextStyles.pageTitleH1(context),
|
Text(
|
||||||
|
"${balance.getTotal()}"
|
||||||
|
" ${token.symbol}",
|
||||||
|
style: STextStyles.pageTitleH1(context),
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
width: 10,
|
||||||
|
),
|
||||||
|
RoundedContainer(
|
||||||
|
padding: const EdgeInsets.symmetric(vertical: 2, horizontal: 4),
|
||||||
|
radiusMultiplier: 0.25,
|
||||||
|
color: const Color(
|
||||||
|
0xFF4D5798), // TODO: color theme for multi themes
|
||||||
|
child: Text(
|
||||||
|
ref.watch(walletsChangeNotifierProvider.select(
|
||||||
|
(value) => value.getManager(walletId).coin.ticker)),
|
||||||
|
style: STextStyles.w600_12(context).copyWith(
|
||||||
|
color: Colors.white, // TODO: design is wrong?
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 6,
|
height: 6,
|
||||||
|
|
|
@ -6,18 +6,15 @@ import 'package:stackwallet/pages/token_view/sub_widgets/token_summary.dart';
|
||||||
import 'package:stackwallet/pages/token_view/sub_widgets/token_transaction_list_widget.dart';
|
import 'package:stackwallet/pages/token_view/sub_widgets/token_transaction_list_widget.dart';
|
||||||
import 'package:stackwallet/pages/wallet_view/sub_widgets/wallet_refresh_button.dart';
|
import 'package:stackwallet/pages/wallet_view/sub_widgets/wallet_refresh_button.dart';
|
||||||
import 'package:stackwallet/pages/wallet_view/transaction_views/all_transactions_view.dart';
|
import 'package:stackwallet/pages/wallet_view/transaction_views/all_transactions_view.dart';
|
||||||
import 'package:stackwallet/providers/global/wallets_provider.dart';
|
|
||||||
import 'package:stackwallet/services/ethereum/ethereum_token_service.dart';
|
import 'package:stackwallet/services/ethereum/ethereum_token_service.dart';
|
||||||
import 'package:stackwallet/services/event_bus/events/global/wallet_sync_status_changed_event.dart';
|
import 'package:stackwallet/services/event_bus/events/global/wallet_sync_status_changed_event.dart';
|
||||||
import 'package:stackwallet/utilities/assets.dart';
|
import 'package:stackwallet/utilities/assets.dart';
|
||||||
import 'package:stackwallet/utilities/constants.dart';
|
import 'package:stackwallet/utilities/constants.dart';
|
||||||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
|
||||||
import 'package:stackwallet/utilities/text_styles.dart';
|
import 'package:stackwallet/utilities/text_styles.dart';
|
||||||
import 'package:stackwallet/utilities/theme/stack_colors.dart';
|
import 'package:stackwallet/utilities/theme/stack_colors.dart';
|
||||||
import 'package:stackwallet/widgets/background.dart';
|
import 'package:stackwallet/widgets/background.dart';
|
||||||
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
|
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
|
||||||
import 'package:stackwallet/widgets/custom_buttons/blue_text_button.dart';
|
import 'package:stackwallet/widgets/custom_buttons/blue_text_button.dart';
|
||||||
import 'package:stackwallet/widgets/rounded_container.dart';
|
|
||||||
|
|
||||||
final tokenServiceStateProvider = StateProvider<EthTokenWallet?>((ref) => null);
|
final tokenServiceStateProvider = StateProvider<EthTokenWallet?>((ref) => null);
|
||||||
final tokenServiceProvider = ChangeNotifierProvider<EthTokenWallet?>(
|
final tokenServiceProvider = ChangeNotifierProvider<EthTokenWallet?>(
|
||||||
|
@ -69,59 +66,63 @@ class _TokenViewState extends ConsumerState<TokenView> {
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
centerTitle: true,
|
// centerTitle: true
|
||||||
title: Row(
|
title: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
SvgPicture.asset(
|
const SizedBox(
|
||||||
Assets.svg.iconForToken(
|
width: 5,
|
||||||
contractAddress: ref.watch(tokenServiceProvider
|
),
|
||||||
.select((value) => value!.tokenContract.address))),
|
Expanded(
|
||||||
width: 24,
|
child: Row(
|
||||||
height: 24,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
SvgPicture.asset(
|
||||||
|
Assets.svg.iconForToken(
|
||||||
|
contractAddress: ref.watch(
|
||||||
|
tokenServiceProvider.select(
|
||||||
|
(value) => value!.tokenContract.address))),
|
||||||
|
width: 24,
|
||||||
|
height: 24,
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
width: 10,
|
||||||
|
),
|
||||||
|
Flexible(
|
||||||
|
child: Text(
|
||||||
|
ref.watch(tokenServiceProvider
|
||||||
|
.select((value) => value!.tokenContract.name)),
|
||||||
|
style: STextStyles.navBarTitle(context),
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
width: 10,
|
width: 28,
|
||||||
),
|
),
|
||||||
Text(
|
WalletRefreshButton(
|
||||||
ref.watch(tokenServiceProvider
|
walletId: widget.walletId,
|
||||||
.select((value) => value!.tokenContract.name)),
|
initialSyncStatus: initialSyncStatus,
|
||||||
style: STextStyles.navBarTitle(context),
|
tokenContractAddress: ref.watch(tokenServiceProvider
|
||||||
overflow: TextOverflow.ellipsis,
|
.select((value) => value!.tokenContract.address)),
|
||||||
),
|
),
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
width: 6,
|
width: 6,
|
||||||
),
|
),
|
||||||
RoundedContainer(
|
AppBarIconButton(
|
||||||
padding: const EdgeInsets.symmetric(vertical: 2, horizontal: 4),
|
icon: SvgPicture.asset(
|
||||||
radiusMultiplier: 0.25,
|
Assets.svg.verticalEllipsis,
|
||||||
color: const Color(
|
|
||||||
0xFF4D5798), // TODO: color theme for multi themes
|
|
||||||
child: Text(
|
|
||||||
ref.watch(walletsChangeNotifierProvider.select((value) =>
|
|
||||||
value.getManager(widget.walletId).coin.ticker)),
|
|
||||||
style: STextStyles.w600_12(context).copyWith(
|
|
||||||
color: Colors.white, // TODO: design is wrong?
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
)
|
onPressed: () {
|
||||||
|
// todo: contract details
|
||||||
|
},
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
actions: [
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.all(10),
|
|
||||||
child: AspectRatio(
|
|
||||||
aspectRatio: 1,
|
|
||||||
child: WalletRefreshButton(
|
|
||||||
walletId: widget.walletId,
|
|
||||||
initialSyncStatus: initialSyncStatus,
|
|
||||||
tokenContractAddress: ref.watch(tokenServiceProvider
|
|
||||||
.select((value) => value!.tokenContract.address)),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
body: Container(
|
body: Container(
|
||||||
color: Theme.of(context).extension<StackColors>()!.background,
|
color: Theme.of(context).extension<StackColors>()!.background,
|
||||||
|
|
Loading…
Reference in a new issue