tor status text

This commit is contained in:
ryleedavis 2023-09-06 16:39:45 -06:00
parent 7289de0160
commit b5fcea18f6

View file

@ -61,6 +61,32 @@ class _TorSettingsViewState extends ConsumerState<TorSettingsView> {
} }
} }
Widget _buildTorStatus(TorSyncStatus status) {
switch (status) {
case TorSyncStatus.unableToSync:
return Text(
"Disconnected",
style: STextStyles.itemSubtitle(context).copyWith(
color: Theme.of(context).extension<StackColors>()!.textSubtitle3),
);
case TorSyncStatus.synced:
return Text(
"Connected",
style: STextStyles.itemSubtitle(context).copyWith(
color:
Theme.of(context).extension<StackColors>()!.accentColorGreen),
);
case TorSyncStatus.syncing:
return Text(
"Connecting",
style: STextStyles.itemSubtitle(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.accentColorYellow),
);
}
}
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -131,7 +157,7 @@ class _TorSettingsViewState extends ConsumerState<TorSettingsView> {
children: [ children: [
Padding( Padding(
padding: const EdgeInsets.all(10.0), padding: const EdgeInsets.all(10.0),
child: _buildTorIcon(TorSyncStatus.unableToSync), child: _buildTorIcon(TorSyncStatus.syncing),
), ),
], ],
), ),
@ -148,10 +174,7 @@ class _TorSettingsViewState extends ConsumerState<TorSettingsView> {
style: STextStyles.titleBold12(context), style: STextStyles.titleBold12(context),
), ),
const Spacer(), const Spacer(),
Text( _buildTorStatus(TorSyncStatus.syncing),
"Tor network status",
style: STextStyles.itemSubtitle(context),
),
], ],
), ),
), ),