cancel sub on dispose and refactor row

This commit is contained in:
sneurlax 2023-09-08 15:59:29 -05:00
parent 16718fd88d
commit 6d24242489

View file

@ -305,6 +305,7 @@ class _WalletNetworkSettingsViewState
_syncStatusSubscription.cancel();
_refreshSubscription.cancel();
_blocksRemainingSubscription?.cancel();
_torConnectionStatusSubscription.cancel();
super.dispose();
}
@ -777,7 +778,6 @@ class _WalletNetworkSettingsViewState
SizedBox(
height: isDesktop ? 32 : 20,
),
if (TorService.sharedInstance.enabled)
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
@ -788,6 +788,7 @@ class _WalletNetworkSettingsViewState
? STextStyles.desktopTextExtraExtraSmall(context)
: STextStyles.smallMed12(context),
),
if (TorService.sharedInstance.enabled)
GestureDetector(
onTap: () {
TorService.sharedInstance.stop();
@ -797,19 +798,7 @@ class _WalletNetworkSettingsViewState
style: STextStyles.link2(context),
),
),
],
),
if (!TorService.sharedInstance.enabled)
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"Tor status",
textAlign: TextAlign.left,
style: isDesktop
? STextStyles.desktopTextExtraExtraSmall(context)
: STextStyles.smallMed12(context),
),
GestureDetector(
onTap: () {
TorService.sharedInstance.start();