From 7289de016060011d699eb094a3b6e89d6a3f125a Mon Sep 17 00:00:00 2001 From: ryleedavis Date: Wed, 6 Sep 2023 14:26:04 -0600 Subject: [PATCH] minor ui fixes --- lib/pages/home_view/home_view.dart | 2 +- .../tor_settings/tor_settings_view.dart | 33 ++++++++++++++++--- lib/pages_desktop_specific/desktop_menu.dart | 4 +-- 3 files changed, 31 insertions(+), 8 deletions(-) diff --git a/lib/pages/home_view/home_view.dart b/lib/pages/home_view/home_view.dart index ebd53abdb..759c7760d 100644 --- a/lib/pages/home_view/home_view.dart +++ b/lib/pages/home_view/home_view.dart @@ -122,7 +122,7 @@ class _HomeViewState extends ConsumerState { case TorSyncStatus.unableToSync: return SvgPicture.asset( Assets.svg.tor, - color: Theme.of(context).extension()!.infoItemLabel, + color: Theme.of(context).extension()!.textSubtitle3, width: 20, height: 20, ); diff --git a/lib/pages/settings_views/global_settings_view/tor_settings/tor_settings_view.dart b/lib/pages/settings_views/global_settings_view/tor_settings/tor_settings_view.dart index 29a53ba7e..366aff80a 100644 --- a/lib/pages/settings_views/global_settings_view/tor_settings/tor_settings_view.dart +++ b/lib/pages/settings_views/global_settings_view/tor_settings/tor_settings_view.dart @@ -11,6 +11,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/flutter_svg.dart'; +import 'package:stackwallet/pages/home_view/sub_widgets/tor_sync_status_changed_event.dart'; import 'package:stackwallet/providers/global/prefs_provider.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/utilities/assets.dart'; @@ -34,6 +35,32 @@ class TorSettingsView extends ConsumerStatefulWidget { } class _TorSettingsViewState extends ConsumerState { + Widget _buildTorIcon(TorSyncStatus status) { + switch (status) { + case TorSyncStatus.unableToSync: + return SvgPicture.asset( + Assets.svg.tor, + color: Theme.of(context).extension()!.textSubtitle3, + width: 200, + height: 200, + ); + case TorSyncStatus.synced: + return SvgPicture.asset( + Assets.svg.tor, + color: Theme.of(context).extension()!.accentColorGreen, + width: 200, + height: 200, + ); + case TorSyncStatus.syncing: + return SvgPicture.asset( + Assets.svg.tor, + color: Theme.of(context).extension()!.accentColorYellow, + width: 200, + height: 200, + ); + } + } + @override void initState() { super.initState(); @@ -104,11 +131,7 @@ class _TorSettingsViewState extends ConsumerState { children: [ Padding( padding: const EdgeInsets.all(10.0), - child: SvgPicture.asset( - Assets.svg.tor, - height: 200, - width: 200, - ), + child: _buildTorIcon(TorSyncStatus.unableToSync), ), ], ), diff --git a/lib/pages_desktop_specific/desktop_menu.dart b/lib/pages_desktop_specific/desktop_menu.dart index f89fd3aef..6e0b38c65 100644 --- a/lib/pages_desktop_specific/desktop_menu.dart +++ b/lib/pages_desktop_specific/desktop_menu.dart @@ -66,7 +66,7 @@ class _DesktopMenuState extends ConsumerState { children: [ SvgPicture.asset( Assets.svg.tor, - color: Theme.of(context).extension()!.infoItemLabel, + color: Theme.of(context).extension()!.textSubtitle3, width: 20, height: 20, ), @@ -75,7 +75,7 @@ class _DesktopMenuState extends ConsumerState { style: STextStyles.smallMed12(context).copyWith( color: Theme.of(context) .extension()! - .infoItemLabel), + .textSubtitle3), ) ], );