hook mobile home view onion up to tor status

This commit is contained in:
sneurlax 2023-09-12 15:58:30 -05:00
parent 6594e3c0cf
commit 17e83a68a3

View file

@ -26,6 +26,7 @@ import 'package:stackwallet/providers/global/notifications_provider.dart';
import 'package:stackwallet/providers/ui/home_view_index_provider.dart'; import 'package:stackwallet/providers/ui/home_view_index_provider.dart';
import 'package:stackwallet/providers/ui/unread_notifications_provider.dart'; import 'package:stackwallet/providers/ui/unread_notifications_provider.dart';
import 'package:stackwallet/services/event_bus/events/global/tor_connection_status_changed_event.dart'; import 'package:stackwallet/services/event_bus/events/global/tor_connection_status_changed_event.dart';
import 'package:stackwallet/services/tor_service.dart';
import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/themes/stack_colors.dart';
import 'package:stackwallet/themes/theme_providers.dart'; import 'package:stackwallet/themes/theme_providers.dart';
import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/assets.dart';
@ -261,7 +262,32 @@ class _HomeViewState extends ConsumerState<HomeView> {
color: Theme.of(context) color: Theme.of(context)
.extension<StackColors>()! .extension<StackColors>()!
.backgroundAppBar, .backgroundAppBar,
icon: _buildTorIcon(TorConnectionStatus.disconnected), icon: ref.watch(pTorService).enabled
? ref.read(pTorService).proxyInfo.port == -1
? SvgPicture.asset(
Assets.svg.tor,
color: Theme.of(context)
.extension<StackColors>()!
.accentColorYellow,
width: 20,
height: 20,
)
: SvgPicture.asset(
Assets.svg.tor,
color: Theme.of(context)
.extension<StackColors>()!
.accentColorGreen,
width: 20,
height: 20,
)
: SvgPicture.asset(
Assets.svg.tor,
color: Theme.of(context)
.extension<StackColors>()!
.textSubtitle3,
width: 20,
height: 20,
),
onPressed: () { onPressed: () {
Navigator.of(context) Navigator.of(context)
.pushNamed(TorSettingsView.routeName); .pushNamed(TorSettingsView.routeName);