2024-04-17 18:04:55 +00:00
|
|
|
import 'package:flutter/cupertino.dart';
|
2024-05-23 00:37:06 +00:00
|
|
|
import '../../wallets/crypto_currency/crypto_currency.dart';
|
|
|
|
import '../desktop/primary_button.dart';
|
|
|
|
import '../desktop/secondary_button.dart';
|
|
|
|
import 'basic_dialog.dart';
|
2024-04-17 18:04:55 +00:00
|
|
|
|
|
|
|
class TorWarningDialog extends StatelessWidget {
|
2024-05-15 21:20:45 +00:00
|
|
|
final CryptoCurrency coin;
|
2024-04-17 18:04:55 +00:00
|
|
|
final VoidCallback? onContinue;
|
|
|
|
final VoidCallback? onCancel;
|
|
|
|
|
2024-05-15 21:20:45 +00:00
|
|
|
const TorWarningDialog({
|
|
|
|
super.key,
|
2024-04-17 18:04:55 +00:00
|
|
|
required this.coin,
|
|
|
|
this.onContinue,
|
|
|
|
this.onCancel,
|
2024-05-15 21:20:45 +00:00
|
|
|
});
|
2024-04-17 18:04:55 +00:00
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return BasicDialog(
|
|
|
|
title: "Warning! Tor not supported.",
|
|
|
|
message: "${coin.prettyName} is not compatible with Tor. "
|
|
|
|
"Continuing will leak your IP address."
|
|
|
|
"\n\nAre you sure you want to continue?",
|
|
|
|
// A PrimaryButton widget:
|
|
|
|
leftButton: PrimaryButton(
|
|
|
|
label: "Cancel",
|
|
|
|
onPressed: () {
|
|
|
|
onCancel?.call();
|
|
|
|
Navigator.of(context).pop(false);
|
|
|
|
},
|
|
|
|
),
|
|
|
|
rightButton: SecondaryButton(
|
|
|
|
label: "Continue",
|
|
|
|
onPressed: () {
|
|
|
|
onContinue?.call();
|
|
|
|
Navigator.of(context).pop(true);
|
|
|
|
},
|
|
|
|
),
|
2024-04-17 18:05:23 +00:00
|
|
|
flex: true,
|
2024-04-17 18:04:55 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|