mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-09-29 18:01:06 +00:00
mobile Tor warning
This commit is contained in:
parent
1328a5eb65
commit
53e401edb8
1 changed files with 21 additions and 0 deletions
|
@ -17,6 +17,7 @@ import 'package:flutter_svg/svg.dart';
|
||||||
import 'package:stackwallet/pages/wallet_view/wallet_view.dart';
|
import 'package:stackwallet/pages/wallet_view/wallet_view.dart';
|
||||||
import 'package:stackwallet/pages/wallets_view/wallets_overview.dart';
|
import 'package:stackwallet/pages/wallets_view/wallets_overview.dart';
|
||||||
import 'package:stackwallet/providers/providers.dart';
|
import 'package:stackwallet/providers/providers.dart';
|
||||||
|
import 'package:stackwallet/supported_coins.dart';
|
||||||
import 'package:stackwallet/themes/coin_icon_provider.dart';
|
import 'package:stackwallet/themes/coin_icon_provider.dart';
|
||||||
import 'package:stackwallet/themes/stack_colors.dart';
|
import 'package:stackwallet/themes/stack_colors.dart';
|
||||||
import 'package:stackwallet/utilities/amount/amount.dart';
|
import 'package:stackwallet/utilities/amount/amount.dart';
|
||||||
|
@ -26,6 +27,7 @@ import 'package:stackwallet/utilities/show_loading.dart';
|
||||||
import 'package:stackwallet/utilities/text_styles.dart';
|
import 'package:stackwallet/utilities/text_styles.dart';
|
||||||
import 'package:stackwallet/utilities/util.dart';
|
import 'package:stackwallet/utilities/util.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/cw_based_interface.dart';
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/cw_based_interface.dart';
|
||||||
|
import 'package:stackwallet/widgets/dialogs/tor_warning_dialog.dart';
|
||||||
import 'package:stackwallet/widgets/rounded_white_container.dart';
|
import 'package:stackwallet/widgets/rounded_white_container.dart';
|
||||||
|
|
||||||
class WalletListItem extends ConsumerWidget {
|
class WalletListItem extends ConsumerWidget {
|
||||||
|
@ -58,6 +60,25 @@ class WalletListItem extends ConsumerWidget {
|
||||||
BorderRadius.circular(Constants.size.circularBorderRadius),
|
BorderRadius.circular(Constants.size.circularBorderRadius),
|
||||||
),
|
),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
|
// Check if Tor is enabled...
|
||||||
|
if (ref.read(prefsChangeNotifierProvider).useTor) {
|
||||||
|
// ... and if the coin supports Tor.
|
||||||
|
final cryptocurrency = SupportedCoins.coins[coin];
|
||||||
|
if (cryptocurrency != null && !cryptocurrency!.torSupport) {
|
||||||
|
// If not, show a Tor warning dialog.
|
||||||
|
final shouldContinue = await showDialog<bool>(
|
||||||
|
context: context,
|
||||||
|
builder: (_) => TorWarningDialog(
|
||||||
|
coin: coin,
|
||||||
|
),
|
||||||
|
) ??
|
||||||
|
false;
|
||||||
|
if (!shouldContinue) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (walletCount == 1 && coin != Coin.ethereum) {
|
if (walletCount == 1 && coin != Coin.ethereum) {
|
||||||
final wallet = ref
|
final wallet = ref
|
||||||
.read(pWallets)
|
.read(pWallets)
|
||||||
|
|
Loading…
Reference in a new issue