diff --git a/lib/theme/dark_theme.dart b/lib/theme/dark_theme.dart index 4a3aa0f7..e9d1d3f7 100644 --- a/lib/theme/dark_theme.dart +++ b/lib/theme/dark_theme.dart @@ -322,8 +322,8 @@ DatePickerThemeData datePickerTheme = DatePickerThemeData( side: BorderSide.none, borderRadius: BorderRadius.all(Radius.circular(10)), ), - headerBackgroundColor: WitnetPallet.brightCyanOpacity1, - headerForegroundColor: WitnetPallet.lightGrey, + headerBackgroundColor: WitnetPallet.brightCyan, + headerForegroundColor: WitnetPallet.black, headerHelpStyle: textTheme.titleLarge!.copyWith(color: WitnetPallet.white), weekdayStyle: TextStyle(color: WitnetPallet.lightGrey), dayStyle: diff --git a/lib/widgets/balance.dart b/lib/widgets/balance.dart index c868dfc4..4521cc84 100644 --- a/lib/widgets/balance.dart +++ b/lib/widgets/balance.dart @@ -1,7 +1,4 @@ -import 'dart:async'; - import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:my_wit_wallet/constants.dart'; @@ -13,7 +10,7 @@ import 'package:my_wit_wallet/util/get_localization.dart'; import 'package:my_wit_wallet/util/storage/database/account.dart'; import 'package:my_wit_wallet/util/storage/database/wallet.dart'; import 'package:my_wit_wallet/widgets/PaddedButton.dart'; -import 'package:my_wit_wallet/widgets/snack_bars.dart'; +import 'package:my_wit_wallet/widgets/copy_button.dart'; import 'package:my_wit_wallet/util/extensions/string_extensions.dart'; import 'package:my_wit_wallet/util/extensions/num_extensions.dart'; @@ -93,43 +90,9 @@ class BalanceState extends State { .copyWith(color: extendedTheme.headerTextColor), ))), Flexible( - child: PaddedButton( - padding: EdgeInsets.zero, - label: localization.copyAddressToClipboard, - text: localization.copyAddressToClipboard, - type: ButtonType.iconButton, - color: extendedTheme.headerTextColor, - iconSize: 12, - onPressed: () async { - if (!isAddressCopied) { - await Clipboard.setData( - ClipboardData(text: currentAccount.address)); - if (await Clipboard.hasStrings()) { - ScaffoldMessenger.of(context).clearSnackBars(); - ScaffoldMessenger.of(context).showSnackBar( - buildCopiedSnackbar( - theme, localization.addressCopied)); - setState(() { - isAddressCopied = true; - }); - if (this.mounted) { - Timer(Duration(milliseconds: 500), () { - setState(() { - isAddressCopied = false; - }); - }); - } - } - } - }, - icon: Icon( - color: extendedTheme.headerTextColor, - isAddressCopied - ? FontAwesomeIcons.check - : FontAwesomeIcons.copy, - size: 12, - )), - ), + child: CopyButton( + copyContent: currentAccount.address, + color: extendedTheme.headerTextColor)), ]), ], ); diff --git a/lib/widgets/copy_button.dart b/lib/widgets/copy_button.dart index 7a2d0015..723e8dca 100644 --- a/lib/widgets/copy_button.dart +++ b/lib/widgets/copy_button.dart @@ -12,7 +12,8 @@ typedef void VoidCallback(); class CopyButton extends StatefulWidget { final String copyContent; - CopyButton({required this.copyContent}); + final Color? color; + CopyButton({required this.copyContent, this.color}); @override CopyButtonState createState() => CopyButtonState(); @@ -31,7 +32,9 @@ class CopyButtonState extends State { label: localization.copyAddressToClipboard, text: localization.copyAddressToClipboard, type: ButtonType.iconButton, - color: extendedTheme.headerTextColor, + color: widget.color != null + ? extendedTheme.headerTextColor + : theme.textTheme.bodyMedium!.color, iconSize: 12, onPressed: () async { if (!isAddressCopied) { @@ -54,7 +57,9 @@ class CopyButtonState extends State { } }, icon: Icon( - color: extendedTheme.headerTextColor, + color: widget.color != null + ? extendedTheme.headerTextColor + : theme.textTheme.bodyMedium!.color, isAddressCopied ? FontAwesomeIcons.check : FontAwesomeIcons.copy, size: 12, )); diff --git a/lib/widgets/link.dart b/lib/widgets/link.dart index 96986ee4..e79fe749 100644 --- a/lib/widgets/link.dart +++ b/lib/widgets/link.dart @@ -21,6 +21,8 @@ class CustomLink extends StatelessWidget { Widget build(BuildContext context) { final theme = Theme.of(context); final extendedTheme = theme.extension()!; + Color? contentColor = + color != null ? color : extendedTheme.monoSmallText!.color; return MouseRegion( cursor: SystemMouseCursors.click, child: GestureDetector( @@ -28,10 +30,9 @@ class CustomLink extends StatelessWidget { padding: EdgeInsets.only(right: 8), child: Text(text, style: extendedTheme.monoSmallText!.copyWith( - color: color != null - ? color - : extendedTheme.monoSmallText!.color, + color: contentColor, fontWeight: FontWeight.w400, + decorationColor: contentColor, decoration: TextDecoration.underline))), onTap: () => {_launchUrl(url)}, )); diff --git a/lib/widgets/top_navigation.dart b/lib/widgets/top_navigation.dart index 03b1c7d1..63154ecb 100644 --- a/lib/widgets/top_navigation.dart +++ b/lib/widgets/top_navigation.dart @@ -54,9 +54,9 @@ class TopNavigation extends StatelessWidget { decoration: BoxDecoration( color: WitnetPallet.black, border: Border.all(color: WitnetPallet.black), - borderRadius: BorderRadius.all(Radius.circular(8))), + borderRadius: BorderRadius.all(Radius.circular(24))), child: ClipRRect( - borderRadius: BorderRadius.all(Radius.circular(8)), + borderRadius: BorderRadius.all(Radius.circular(24)), child: Container( decoration: BoxDecoration( color: WitnetPallet.black,