diff --git a/lib/pages/address_book_views/subviews/add_address_book_entry_view.dart b/lib/pages/address_book_views/subviews/add_address_book_entry_view.dart index 36191e0b7..caffb65c7 100644 --- a/lib/pages/address_book_views/subviews/add_address_book_entry_view.dart +++ b/lib/pages/address_book_views/subviews/add_address_book_entry_view.dart @@ -584,7 +584,7 @@ class _AddAddressBookEntryViewState "Address ${i + 1}", style: STextStyles.smallMed12(context), ), - BlueTextButton( + CustomTextButton( onTap: () { _removeForm(forms[i].id); }, @@ -601,7 +601,7 @@ class _AddAddressBookEntryViewState const SizedBox( height: 16, ), - BlueTextButton( + CustomTextButton( onTap: () { _addForm(); scrollController.animateTo( diff --git a/lib/pages/address_book_views/subviews/contact_details_view.dart b/lib/pages/address_book_views/subviews/contact_details_view.dart index ff15420ca..4f417c9a5 100644 --- a/lib/pages/address_book_views/subviews/contact_details_view.dart +++ b/lib/pages/address_book_views/subviews/contact_details_view.dart @@ -311,7 +311,7 @@ class _ContactDetailsViewState extends ConsumerState { "Addresses", style: STextStyles.itemSubtitle(context), ), - BlueTextButton( + CustomTextButton( text: "Add new", onTap: () { Navigator.of(context).pushNamed( diff --git a/lib/pages/buy_view/buy_form.dart b/lib/pages/buy_view/buy_form.dart index 051afcf71..30bd05106 100644 --- a/lib/pages/buy_view/buy_form.dart +++ b/lib/pages/buy_view/buy_form.dart @@ -953,7 +953,7 @@ class _BuyFormState extends ConsumerState { Theme.of(context).extension()!.textDark3, ), ), - BlueTextButton( + CustomTextButton( text: buyWithFiat ? "Use crypto amount" : "Use fiat amount", onTap: () { setState(() { @@ -1129,7 +1129,7 @@ class _BuyFormState extends ConsumerState { ), ), if (isStackCoin(selectedCrypto?.ticker)) - BlueTextButton( + CustomTextButton( text: "Choose from stack", onTap: () { try { diff --git a/lib/pages/exchange_view/exchange_step_views/step_2_view.dart b/lib/pages/exchange_view/exchange_step_views/step_2_view.dart index 238499c5f..081709c31 100644 --- a/lib/pages/exchange_view/exchange_step_views/step_2_view.dart +++ b/lib/pages/exchange_view/exchange_step_views/step_2_view.dart @@ -189,7 +189,7 @@ class _Step2ViewState extends ConsumerState { style: STextStyles.smallMed12(context), ), if (isStackCoin(model.receiveTicker)) - BlueTextButton( + CustomTextButton( text: "Choose from stack", onTap: () { try { @@ -448,7 +448,7 @@ class _Step2ViewState extends ConsumerState { style: STextStyles.smallMed12(context), ), if (isStackCoin(model.sendTicker)) - BlueTextButton( + CustomTextButton( text: "Choose from stack", onTap: () { try { diff --git a/lib/pages/exchange_view/trade_details_view.dart b/lib/pages/exchange_view/trade_details_view.dart index 9d8a1d223..4e42ff888 100644 --- a/lib/pages/exchange_view/trade_details_view.dart +++ b/lib/pages/exchange_view/trade_details_view.dart @@ -516,7 +516,7 @@ class _TradeDetailsViewState extends ConsumerState { const SizedBox( height: 10, ), - BlueTextButton( + CustomTextButton( text: "View transaction", onTap: () { final Coin coin = diff --git a/lib/pages/paynym/dialogs/paynym_qr_popup.dart b/lib/pages/paynym/dialogs/paynym_qr_popup.dart index 4ff6d9ca0..e712884b1 100644 --- a/lib/pages/paynym/dialogs/paynym_qr_popup.dart +++ b/lib/pages/paynym/dialogs/paynym_qr_popup.dart @@ -118,7 +118,7 @@ class PaynymQrPopup extends StatelessWidget { const SizedBox( height: 6, ), - BlueTextButton( + CustomTextButton( text: "Copy", textSize: isDesktop ? 18 : 10, onTap: () async { diff --git a/lib/pages/paynym/subwidgets/desktop_paynym_details.dart b/lib/pages/paynym/subwidgets/desktop_paynym_details.dart index 61db83d7b..5076e2450 100644 --- a/lib/pages/paynym/subwidgets/desktop_paynym_details.dart +++ b/lib/pages/paynym/subwidgets/desktop_paynym_details.dart @@ -324,7 +324,7 @@ class _PaynymDetailsPopupState extends ConsumerState { const SizedBox( height: 8, ), - BlueTextButton( + CustomTextButton( text: "Copy", onTap: () async { await Clipboard.setData( diff --git a/lib/pages/receive_view/receive_view.dart b/lib/pages/receive_view/receive_view.dart index c43964779..b6ae7c70a 100644 --- a/lib/pages/receive_view/receive_view.dart +++ b/lib/pages/receive_view/receive_view.dart @@ -233,7 +233,7 @@ class _ReceiveViewState extends ConsumerState { const SizedBox( height: 20, ), - BlueTextButton( + CustomTextButton( text: "Create new QR code", onTap: () async { unawaited(Navigator.of(context).push( diff --git a/lib/pages/send_view/send_view.dart b/lib/pages/send_view/send_view.dart index c9216bf0e..c472bcc11 100644 --- a/lib/pages/send_view/send_view.dart +++ b/lib/pages/send_view/send_view.dart @@ -1304,7 +1304,7 @@ class _SendViewState extends ConsumerState { style: STextStyles.smallMed12(context), textAlign: TextAlign.left, ), - BlueTextButton( + CustomTextButton( text: "Send all ${coin.ticker}", onTap: () async { if (coin == Coin.firo || diff --git a/lib/pages/settings_views/global_settings_view/about_view.dart b/lib/pages/settings_views/global_settings_view/about_view.dart index a1e78ba7d..bf0f4a507 100644 --- a/lib/pages/settings_views/global_settings_view/about_view.dart +++ b/lib/pages/settings_views/global_settings_view/about_view.dart @@ -484,7 +484,7 @@ class AboutView extends ConsumerWidget { const SizedBox( height: 4, ), - BlueTextButton( + CustomTextButton( text: "https://stackwallet.com", onTap: () { launchUrl( diff --git a/lib/pages/settings_views/global_settings_view/advanced_views/debug_view.dart b/lib/pages/settings_views/global_settings_view/advanced_views/debug_view.dart index 5c12fb1ad..d86dbe272 100644 --- a/lib/pages/settings_views/global_settings_view/advanced_views/debug_view.dart +++ b/lib/pages/settings_views/global_settings_view/advanced_views/debug_view.dart @@ -282,7 +282,7 @@ class _DebugViewState extends ConsumerState { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - BlueTextButton( + CustomTextButton( text: "Save Debug Info to clipboard", onTap: () async { try { @@ -350,7 +350,7 @@ class _DebugViewState extends ConsumerState { }, ), const Spacer(), - BlueTextButton( + CustomTextButton( text: "Save logs to file", onTap: () async { final systemfile = SWBFileSystem(); diff --git a/lib/pages/settings_views/global_settings_view/manage_nodes_views/coin_nodes_view.dart b/lib/pages/settings_views/global_settings_view/manage_nodes_views/coin_nodes_view.dart index 91e6871f3..85d28eb66 100644 --- a/lib/pages/settings_views/global_settings_view/manage_nodes_views/coin_nodes_view.dart +++ b/lib/pages/settings_views/global_settings_view/manage_nodes_views/coin_nodes_view.dart @@ -92,7 +92,7 @@ class _CoinNodesViewState extends ConsumerState { ), textAlign: TextAlign.left, ), - BlueTextButton( + CustomTextButton( text: "Add new node", onTap: () { Navigator.of(context).pushNamed( diff --git a/lib/pages/settings_views/global_settings_view/stack_backup_views/auto_backup_view.dart b/lib/pages/settings_views/global_settings_view/stack_backup_views/auto_backup_view.dart index 85fd9c1e9..6a43d963e 100644 --- a/lib/pages/settings_views/global_settings_view/stack_backup_views/auto_backup_view.dart +++ b/lib/pages/settings_views/global_settings_view/stack_backup_views/auto_backup_view.dart @@ -327,7 +327,7 @@ class _AutoBackupViewState extends ConsumerState { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - BlueTextButton( + CustomTextButton( text: "Back up now", onTap: () { ref.read(autoSWBServiceProvider).doBackup(); @@ -448,7 +448,7 @@ class _AutoBackupViewState extends ConsumerState { height: 20, ), Center( - child: BlueTextButton( + child: CustomTextButton( text: "Edit Auto Backup", onTap: () async { Navigator.of(context) diff --git a/lib/pages/settings_views/wallet_settings_view/wallet_network_settings_view/wallet_network_settings_view.dart b/lib/pages/settings_views/wallet_settings_view/wallet_network_settings_view/wallet_network_settings_view.dart index 21e0f2d49..526ef0e79 100644 --- a/lib/pages/settings_views/wallet_settings_view/wallet_network_settings_view/wallet_network_settings_view.dart +++ b/lib/pages/settings_views/wallet_settings_view/wallet_network_settings_view/wallet_network_settings_view.dart @@ -749,7 +749,7 @@ class _WalletNetworkSettingsViewState ? STextStyles.desktopTextExtraExtraSmall(context) : STextStyles.smallMed12(context), ), - BlueTextButton( + CustomTextButton( text: "Add new node", onTap: () { Navigator.of(context).pushNamed( @@ -880,7 +880,7 @@ class _WalletNetworkSettingsViewState top: 16, bottom: 6, ), - child: BlueTextButton( + child: CustomTextButton( text: "Rescan", onTap: () async { await Navigator.of(context).push( diff --git a/lib/pages/wallet_view/transaction_views/transaction_details_view.dart b/lib/pages/wallet_view/transaction_views/transaction_details_view.dart index af82a250d..5b737a939 100644 --- a/lib/pages/wallet_view/transaction_views/transaction_details_view.dart +++ b/lib/pages/wallet_view/transaction_views/transaction_details_view.dart @@ -1092,7 +1092,7 @@ class _TransactionDetailsViewState height: 8, ), if (coin != Coin.epicCash) - BlueTextButton( + CustomTextButton( text: "Open in block explorer", onTap: () async { final uri = diff --git a/lib/pages/wallet_view/wallet_view.dart b/lib/pages/wallet_view/wallet_view.dart index fd5473b11..04817a843 100644 --- a/lib/pages/wallet_view/wallet_view.dart +++ b/lib/pages/wallet_view/wallet_view.dart @@ -649,7 +649,7 @@ class _WalletViewState extends ConsumerState { .textDark3, ), ), - BlueTextButton( + CustomTextButton( text: "See all", onTap: () { Navigator.of(context).pushNamed( diff --git a/lib/pages/wallets_view/sub_widgets/all_wallets.dart b/lib/pages/wallets_view/sub_widgets/all_wallets.dart index eae7374bf..b63e8eb6e 100644 --- a/lib/pages/wallets_view/sub_widgets/all_wallets.dart +++ b/lib/pages/wallets_view/sub_widgets/all_wallets.dart @@ -24,7 +24,7 @@ class AllWallets extends StatelessWidget { color: Theme.of(context).extension()!.textDark, ), ), - BlueTextButton( + CustomTextButton( text: "Add new", onTap: () { Navigator.of(context).pushNamed(AddWalletView.routeName); diff --git a/lib/pages_desktop_specific/address_book_view/subwidgets/desktop_address_card.dart b/lib/pages_desktop_specific/address_book_view/subwidgets/desktop_address_card.dart index ad9310df2..518e593b0 100644 --- a/lib/pages_desktop_specific/address_book_view/subwidgets/desktop_address_card.dart +++ b/lib/pages_desktop_specific/address_book_view/subwidgets/desktop_address_card.dart @@ -66,7 +66,7 @@ class DesktopAddressCard extends StatelessWidget { ), Row( children: [ - BlueTextButton( + CustomTextButton( text: "Copy", onTap: () { clipboard.setData( @@ -87,7 +87,7 @@ class DesktopAddressCard extends StatelessWidget { if (contactId != "default") Consumer( builder: (context, ref, child) { - return BlueTextButton( + return CustomTextButton( text: "Edit", onTap: () async { ref.refresh( diff --git a/lib/pages_desktop_specific/address_book_view/subwidgets/desktop_contact_details.dart b/lib/pages_desktop_specific/address_book_view/subwidgets/desktop_contact_details.dart index 98fce4a0b..4b2eb33a8 100644 --- a/lib/pages_desktop_specific/address_book_view/subwidgets/desktop_contact_details.dart +++ b/lib/pages_desktop_specific/address_book_view/subwidgets/desktop_contact_details.dart @@ -182,7 +182,7 @@ class _DesktopContactDetailsState extends ConsumerState { style: STextStyles.desktopTextExtraExtraSmall(context), ), - BlueTextButton( + CustomTextButton( text: "Add new", onTap: () async { ref.refresh( diff --git a/lib/pages_desktop_specific/desktop_exchange/exchange_steps/subwidgets/desktop_step_2.dart b/lib/pages_desktop_specific/desktop_exchange/exchange_steps/subwidgets/desktop_step_2.dart index 027de6cd7..c959e0f45 100644 --- a/lib/pages_desktop_specific/desktop_exchange/exchange_steps/subwidgets/desktop_step_2.dart +++ b/lib/pages_desktop_specific/desktop_exchange/exchange_steps/subwidgets/desktop_step_2.dart @@ -300,7 +300,7 @@ class _DesktopStep2State extends ConsumerState { ), if (isStackCoin(ref.watch(desktopExchangeModelProvider .select((value) => value!.receiveTicker)))) - BlueTextButton( + CustomTextButton( text: "Choose from stack", onTap: selectRecipientAddressFromStack, ), @@ -432,7 +432,7 @@ class _DesktopStep2State extends ConsumerState { ), if (isStackCoin(ref.watch(desktopExchangeModelProvider .select((value) => value!.sendTicker)))) - BlueTextButton( + CustomTextButton( text: "Choose from stack", onTap: selectRefundAddressFromStack, ), diff --git a/lib/pages_desktop_specific/desktop_exchange/subwidgets/desktop_choose_from_stack.dart b/lib/pages_desktop_specific/desktop_exchange/subwidgets/desktop_choose_from_stack.dart index 3216949b0..2c1d8a44d 100644 --- a/lib/pages_desktop_specific/desktop_exchange/subwidgets/desktop_choose_from_stack.dart +++ b/lib/pages_desktop_specific/desktop_exchange/subwidgets/desktop_choose_from_stack.dart @@ -221,7 +221,7 @@ class _DesktopChooseFromStackState const SizedBox( width: 80, ), - BlueTextButton( + CustomTextButton( text: "Select wallet", onTap: () async { final address = diff --git a/lib/pages_desktop_specific/desktop_exchange/subwidgets/desktop_trade_history.dart b/lib/pages_desktop_specific/desktop_exchange/subwidgets/desktop_trade_history.dart index 296847d71..b87ca6c6b 100644 --- a/lib/pages_desktop_specific/desktop_exchange/subwidgets/desktop_trade_history.dart +++ b/lib/pages_desktop_specific/desktop_exchange/subwidgets/desktop_trade_history.dart @@ -72,7 +72,7 @@ class _DesktopTradeHistoryState extends ConsumerState { "Recent trades", style: STextStyles.desktopTextExtraExtraSmall(context), ), - BlueTextButton( + CustomTextButton( text: "See all", onTap: () { Navigator.of(context) diff --git a/lib/pages_desktop_specific/my_stack_view/desktop_favorite_wallets.dart b/lib/pages_desktop_specific/my_stack_view/desktop_favorite_wallets.dart index 91130fe19..5694c66ed 100644 --- a/lib/pages_desktop_specific/my_stack_view/desktop_favorite_wallets.dart +++ b/lib/pages_desktop_specific/my_stack_view/desktop_favorite_wallets.dart @@ -39,7 +39,7 @@ class DesktopFavoriteWallets extends ConsumerWidget { .textFieldActiveSearchIconRight, ), ), - BlueTextButton( + CustomTextButton( text: "Edit", onTap: () { Navigator.of(context).pushNamed(ManageFavoritesView.routeName); diff --git a/lib/pages_desktop_specific/my_stack_view/my_wallets.dart b/lib/pages_desktop_specific/my_stack_view/my_wallets.dart index 41d0f0ce5..1dd345f74 100644 --- a/lib/pages_desktop_specific/my_stack_view/my_wallets.dart +++ b/lib/pages_desktop_specific/my_stack_view/my_wallets.dart @@ -38,7 +38,7 @@ class _MyWalletsState extends ConsumerState { ), ), const Spacer(), - BlueTextButton( + CustomTextButton( text: "Add new wallet", onTap: () { Navigator.of( diff --git a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/address_book_address_chooser/sub_widgets/contact_list_item.dart b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/address_book_address_chooser/sub_widgets/contact_list_item.dart index 1277c5c0f..7ae3c51e4 100644 --- a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/address_book_address_chooser/sub_widgets/contact_list_item.dart +++ b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/address_book_address_chooser/sub_widgets/contact_list_item.dart @@ -133,7 +133,7 @@ class _ContactListItemState extends ConsumerState { ], ), ), - BlueTextButton( + CustomTextButton( text: "Select wallet", onTap: () { Navigator.of(context).pop(e); diff --git a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_send.dart b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_send.dart index c4f7eee34..cc63c67a8 100644 --- a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_send.dart +++ b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_send.dart @@ -987,7 +987,7 @@ class _DesktopSendState extends ConsumerState { ), textAlign: TextAlign.left, ), - BlueTextButton( + CustomTextButton( text: "Send all ${coin.ticker}", onTap: sendAllTapped, ), diff --git a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/recent_desktop_transactions.dart b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/recent_desktop_transactions.dart index 59e01f0b7..dca501e25 100644 --- a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/recent_desktop_transactions.dart +++ b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/recent_desktop_transactions.dart @@ -37,7 +37,7 @@ class _RecentDesktopTransactionsState .textFieldActiveSearchIconLeft, ), ), - BlueTextButton( + CustomTextButton( text: "See all", onTap: () { Navigator.of(context).pushNamed( diff --git a/lib/pages_desktop_specific/password/desktop_login_view.dart b/lib/pages_desktop_specific/password/desktop_login_view.dart index 67eab0903..05ad2d2ad 100644 --- a/lib/pages_desktop_specific/password/desktop_login_view.dart +++ b/lib/pages_desktop_specific/password/desktop_login_view.dart @@ -261,7 +261,7 @@ class _DesktopLoginViewState extends ConsumerState { const SizedBox( height: 60, ), - BlueTextButton( + CustomTextButton( text: "Forgot password?", textSize: 20, onTap: () { diff --git a/lib/pages_desktop_specific/settings/settings_menu/backup_and_restore/backup_and_restore_settings.dart b/lib/pages_desktop_specific/settings/settings_menu/backup_and_restore/backup_and_restore_settings.dart index 37b40b004..e3f086746 100644 --- a/lib/pages_desktop_specific/settings/settings_menu/backup_and_restore/backup_and_restore_settings.dart +++ b/lib/pages_desktop_specific/settings/settings_menu/backup_and_restore/backup_and_restore_settings.dart @@ -450,7 +450,7 @@ class _BackupRestoreSettings extends ConsumerState { STextStyles.itemSubtitle( context), ), - BlueTextButton( + CustomTextButton( text: "Back up now", onTap: () { ref diff --git a/lib/pages_desktop_specific/settings/settings_menu/desktop_about_view.dart b/lib/pages_desktop_specific/settings/settings_menu/desktop_about_view.dart index 18988cb68..242fbfd9f 100644 --- a/lib/pages_desktop_specific/settings/settings_menu/desktop_about_view.dart +++ b/lib/pages_desktop_specific/settings/settings_menu/desktop_about_view.dart @@ -678,7 +678,7 @@ class DesktopAboutView extends ConsumerWidget { const SizedBox( height: 2, ), - BlueTextButton( + CustomTextButton( text: "https://stackwallet.com", onTap: () { diff --git a/lib/utilities/featured_paynyms.dart b/lib/utilities/featured_paynyms.dart index 2a99bc459..a04fa9a7d 100644 --- a/lib/utilities/featured_paynyms.dart +++ b/lib/utilities/featured_paynyms.dart @@ -3,7 +3,7 @@ abstract class FeaturedPaynyms { // static const String samouraiWalletDevFund = // "PM8TJYkuSdYXJnwDBq8ChfinfXv3srxhQrx3eoEwbSw51wMjdo9JJ2DsycwT3gt3zHQ7cV1grvabMmmf1Btj6fY7tgkgSz9B8MZuR3kjYfgMLMURJCXN"; static const String stackWallet = - "PM8TJPdEeH3A77h4xJYQeXPWix2W5yAJrzVQ8ggET1n92utnc57FXCoH94Z2wUSJNfGwkX1kNDTCQLkHecVsjQHGkDE8MUyWE4xWJcc1EDDYCeSSBfLL"; + "PM8TJdQcNk27JpxGRtNR7Hnh8VkJk4Nf17BthLx89fM3iX3UL2YshyaiTAvKgTCVvpgsAgY1DbojkAaUd3Rcn48NEn4uUBuqkaSddgKL8TPAAEQXNuE6"; static Map get featured => { "Stack Wallet": stackWallet, diff --git a/lib/widgets/custom_buttons/blue_text_button.dart b/lib/widgets/custom_buttons/blue_text_button.dart index 7877ddcde..8be6bb937 100644 --- a/lib/widgets/custom_buttons/blue_text_button.dart +++ b/lib/widgets/custom_buttons/blue_text_button.dart @@ -1,17 +1,17 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:stackwallet/providers/ui/color_theme_provider.dart'; import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/utilities/theme/stack_colors.dart'; import 'package:stackwallet/utilities/util.dart'; import 'package:stackwallet/widgets/conditional_parent.dart'; import 'package:stackwallet/widgets/rounded_container.dart'; -class BlueTextButton extends ConsumerStatefulWidget { - const BlueTextButton({ +class _CustomTextButton extends StatefulWidget { + const _CustomTextButton({ Key? key, required this.text, + required this.enabledColor, + required this.disabledColor, this.onTap, this.enabled = true, this.textSize, @@ -21,12 +21,14 @@ class BlueTextButton extends ConsumerStatefulWidget { final VoidCallback? onTap; final bool enabled; final double? textSize; + final Color enabledColor; + final Color disabledColor; @override - ConsumerState createState() => _BlueTextButtonState(); + State<_CustomTextButton> createState() => _CustomTextButtonState(); } -class _BlueTextButtonState extends ConsumerState +class _CustomTextButtonState extends State<_CustomTextButton> with SingleTickerProviderStateMixin { AnimationController? controller; Animation? animation; @@ -37,18 +39,14 @@ class _BlueTextButtonState extends ConsumerState @override void initState() { if (widget.enabled) { - color = ref.read(colorThemeProvider.state).state.buttonTextBorderless; + color = widget.enabledColor; controller = AnimationController( vsync: this, duration: const Duration(milliseconds: 100), ); animation = ColorTween( - begin: ref.read(colorThemeProvider.state).state.buttonTextBorderless, - end: ref - .read(colorThemeProvider.state) - .state - .buttonTextBorderless - .withOpacity(0.4), + begin: widget.enabledColor, + end: widget.enabledColor.withOpacity(0.4), ).animate(controller!); animation!.addListener(() { @@ -57,7 +55,7 @@ class _BlueTextButtonState extends ConsumerState }); }); } else { - color = ref.read(colorThemeProvider.state).state.textSubtitle1; + color = widget.disabledColor; } super.initState(); @@ -116,3 +114,32 @@ class _BlueTextButtonState extends ConsumerState ); } } + +class CustomTextButton extends StatelessWidget { + const CustomTextButton({ + Key? key, + required this.text, + this.onTap, + this.enabled = true, + this.textSize, + }) : super(key: key); + + final String text; + final VoidCallback? onTap; + final bool enabled; + final double? textSize; + + @override + Widget build(BuildContext context) { + return _CustomTextButton( + key: UniqueKey(), + text: text, + enabledColor: + Theme.of(context).extension()!.buttonTextBorderless, + disabledColor: Theme.of(context).extension()!.textSubtitle1, + enabled: enabled, + textSize: textSize, + onTap: onTap, + ); + } +} diff --git a/lib/widgets/node_card.dart b/lib/widgets/node_card.dart index e366cd713..4e51e0d0d 100644 --- a/lib/widgets/node_card.dart +++ b/lib/widgets/node_card.dart @@ -261,7 +261,7 @@ class _NodeCardState extends ConsumerState { const SizedBox( width: 66, ), - BlueTextButton( + CustomTextButton( text: "Connect", enabled: _status == "Disconnected", onTap: () async { @@ -285,7 +285,7 @@ class _NodeCardState extends ConsumerState { const SizedBox( width: 48, ), - BlueTextButton( + CustomTextButton( text: "Details", onTap: () { Navigator.of(context).pushNamed(