mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-26 06:08:40 +01:00
Merge branch 'cake-tech:dev' into dev
This commit is contained in:
@@ -37,5 +37,6 @@ source ./app_env.sh cakewallet
|
||||
./app_config.sh
|
||||
cd ../.. && flutter pub get
|
||||
dart run tool/generate_localization.dart
|
||||
./compile_graphics.sh
|
||||
#./model_generator.sh
|
||||
#cd macos && pod install
|
||||
|
||||
@@ -164,6 +164,8 @@ abstract class BitcoinWalletBase extends ElectrumWallet with Store {
|
||||
}
|
||||
}
|
||||
|
||||
bool get isLightningInitialized => lightningWallet?.isInitialized == true;
|
||||
|
||||
@override
|
||||
bool get hasRescan => true;
|
||||
|
||||
@@ -339,7 +341,7 @@ abstract class BitcoinWalletBase extends ElectrumWallet with Store {
|
||||
@override
|
||||
Future<ElectrumBalance> fetchBalances() async {
|
||||
final balance = await super.fetchBalances();
|
||||
if (lightningWallet == null) {
|
||||
if (!isLightningInitialized || lightningWallet == null) {
|
||||
return balance;
|
||||
}
|
||||
|
||||
@@ -358,7 +360,7 @@ abstract class BitcoinWalletBase extends ElectrumWallet with Store {
|
||||
@override
|
||||
@action
|
||||
Future<void> subscribeForUpdates() async {
|
||||
if (lightningWallet != null) {
|
||||
if (isLightningInitialized && lightningWallet != null) {
|
||||
lightningWallet!.setEventListener(
|
||||
onTransactionEvent: (tx) async {
|
||||
if (transactionHistory.transactions[tx.id]?.isPending != tx.isPending) {
|
||||
|
||||
@@ -41,6 +41,8 @@ class LightningWallet {
|
||||
|
||||
StreamSubscription<LogEntry>? _logSubscription;
|
||||
|
||||
bool get isInitialized => _eventStream != null;
|
||||
|
||||
void _subscribeToLogStream(File logFile) {
|
||||
_logSubscription = _logStream?.listen((logEntry) {
|
||||
logFile.writeAsStringSync("[${logEntry.level}] ${logEntry.line}\n", mode: FileMode.append);
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
PODS:
|
||||
- bitbox_flutter (0.0.1):
|
||||
- Flutter
|
||||
- breez_sdk_spark_flutter (0.9.1):
|
||||
- breez_sdk_spark_flutter (0.11.0):
|
||||
- Flutter
|
||||
- connectivity_plus (0.0.1):
|
||||
- Flutter
|
||||
@@ -303,7 +303,7 @@ EXTERNAL SOURCES:
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
bitbox_flutter: 506f80b961ddf646b0d80cef9f6eadaab96d91b0
|
||||
breez_sdk_spark_flutter: e96b24d1c0ca1ef7dec122dd7bbf63eb921f97f4
|
||||
breez_sdk_spark_flutter: e7d0201b7001ff16f85a7c4820592db5728d4c27
|
||||
connectivity_plus: 2a701ffec2c0ae28a48cf7540e279787e77c447d
|
||||
CryptoSwift: e64e11850ede528a02a0f3e768cec8e9d92ecb90
|
||||
cw_decred: 9c0e1df74745b51a1289ec5e91fb9e24b68fa14a
|
||||
|
||||
@@ -159,11 +159,15 @@ class _NewHomePageState extends State<NewHomePage> {
|
||||
builder: (_) {
|
||||
return Column(
|
||||
children: [
|
||||
CoinActionRow(
|
||||
lightningMode: _lightningMode,
|
||||
showSwap: widget.dashboardViewModel.isEnabledSwapAction,),
|
||||
MwebAd(dashboardViewModel: widget.dashboardViewModel,),
|
||||
],
|
||||
CoinActionRow(
|
||||
lightningMode: _lightningMode,
|
||||
showSwap: widget.dashboardViewModel.isEnabledSwapAction,
|
||||
walletType: widget.dashboardViewModel.wallet.type,
|
||||
),
|
||||
MwebAd(
|
||||
dashboardViewModel: widget.dashboardViewModel,
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
|
||||
+130
-124
@@ -481,134 +481,140 @@ class _NewSwapPageState extends State<NewSwapPage> {
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
RepaintBoundary(
|
||||
child: Form(
|
||||
key: formKey,
|
||||
child: Column(
|
||||
children: [
|
||||
Observer(
|
||||
builder: (_) => SwapAmountBox(
|
||||
isReceiverCard: false,
|
||||
walletSwitcherViewModel: widget.walletSwitcherViewModel,
|
||||
exchangeViewModel: widget.exchangeViewModel,
|
||||
onDispose: disposeBestRateSync,
|
||||
hasAllAmount: widget.exchangeViewModel.hasAllAmount,
|
||||
allAmount: widget.exchangeViewModel.hasAllAmount
|
||||
? () => widget.exchangeViewModel.enableSendAllAmount()
|
||||
: null,
|
||||
key: depositKey,
|
||||
title: S.of(context).send,
|
||||
initialCurrency: widget.exchangeViewModel.depositCurrency,
|
||||
hasRefundAddress: true,
|
||||
currencies: widget.exchangeViewModel.depositCurrencies,
|
||||
onCurrencySelected: (currency) {
|
||||
if (currency is CryptoCurrency) {
|
||||
widget.exchangeViewModel
|
||||
.changeDepositCurrency(currency: currency);
|
||||
}
|
||||
},
|
||||
currencyValueValidator: (value) {
|
||||
return !widget.exchangeViewModel.isFixedRateMode &&
|
||||
value != S.of(context).all
|
||||
? AmountValidator(
|
||||
isAutovalidate: true,
|
||||
currency: widget.exchangeViewModel.isFixedRateMode
|
||||
? widget.exchangeViewModel.receiveCurrency
|
||||
: widget.exchangeViewModel.depositCurrency,
|
||||
minValue: widget.exchangeViewModel.limits.min.toString(),
|
||||
maxValue: widget.exchangeViewModel.limits.max.toString(),
|
||||
amountParsingProxy:
|
||||
widget.exchangeViewModel.amountParsingProxy,
|
||||
).call(value)
|
||||
: null;
|
||||
},
|
||||
addressTextFieldValidator: AddressValidator(
|
||||
type: widget.exchangeViewModel.depositCurrency),
|
||||
onPushPasteButton: (context) async {
|
||||
final clipboard = await Clipboard.getData('text/plain');
|
||||
widget.exchangeViewModel.depositAddress = clipboard?.text ?? '';
|
||||
Expanded(
|
||||
child: RepaintBoundary(
|
||||
child: Form(
|
||||
key: formKey,
|
||||
child: SingleChildScrollView(
|
||||
physics: ClampingScrollPhysics(),
|
||||
controller: ModalScrollController.of(context),
|
||||
child: Column(
|
||||
children: [
|
||||
Observer(
|
||||
builder: (_) => SwapAmountBox(
|
||||
isReceiverCard: false,
|
||||
walletSwitcherViewModel: widget.walletSwitcherViewModel,
|
||||
exchangeViewModel: widget.exchangeViewModel,
|
||||
onDispose: disposeBestRateSync,
|
||||
hasAllAmount: widget.exchangeViewModel.hasAllAmount,
|
||||
allAmount: widget.exchangeViewModel.hasAllAmount
|
||||
? () => widget.exchangeViewModel.enableSendAllAmount()
|
||||
: null,
|
||||
key: depositKey,
|
||||
title: S.of(context).send,
|
||||
initialCurrency: widget.exchangeViewModel.depositCurrency,
|
||||
hasRefundAddress: true,
|
||||
currencies: widget.exchangeViewModel.depositCurrencies,
|
||||
onCurrencySelected: (currency) {
|
||||
if (currency is CryptoCurrency) {
|
||||
widget.exchangeViewModel
|
||||
.changeDepositCurrency(currency: currency);
|
||||
}
|
||||
},
|
||||
currencyValueValidator: (value) {
|
||||
return !widget.exchangeViewModel.isFixedRateMode &&
|
||||
value != S.of(context).all
|
||||
? AmountValidator(
|
||||
isAutovalidate: true,
|
||||
currency: widget.exchangeViewModel.isFixedRateMode
|
||||
? widget.exchangeViewModel.receiveCurrency
|
||||
: widget.exchangeViewModel.depositCurrency,
|
||||
minValue: widget.exchangeViewModel.limits.min.toString(),
|
||||
maxValue: widget.exchangeViewModel.limits.max.toString(),
|
||||
amountParsingProxy:
|
||||
widget.exchangeViewModel.amountParsingProxy,
|
||||
).call(value)
|
||||
: null;
|
||||
},
|
||||
addressTextFieldValidator: AddressValidator(
|
||||
type: widget.exchangeViewModel.depositCurrency),
|
||||
onPushPasteButton: (context) async {
|
||||
final clipboard = await Clipboard.getData('text/plain');
|
||||
widget.exchangeViewModel.depositAddress = clipboard?.text ?? '';
|
||||
|
||||
final domain = widget.exchangeViewModel.depositAddress;
|
||||
widget.exchangeViewModel.depositAddress =
|
||||
await fetchParsedAddress(context, domain,
|
||||
widget.exchangeViewModel.depositCurrency);
|
||||
},
|
||||
onPushAddressBookButton: (context) async {
|
||||
final domain = widget.exchangeViewModel.depositAddress;
|
||||
widget.exchangeViewModel.depositAddress =
|
||||
await fetchParsedAddress(context, domain,
|
||||
widget.exchangeViewModel.depositCurrency);
|
||||
},
|
||||
),
|
||||
),
|
||||
SwapLimitPopup(exchangeViewModel: widget.exchangeViewModel),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 12.0),
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Container(
|
||||
height: 1,
|
||||
width: double.infinity,
|
||||
color: Theme.of(context).colorScheme.surfaceContainerHigh,
|
||||
final domain = widget.exchangeViewModel.depositAddress;
|
||||
widget.exchangeViewModel.depositAddress =
|
||||
await fetchParsedAddress(context, domain,
|
||||
widget.exchangeViewModel.depositCurrency);
|
||||
},
|
||||
onPushAddressBookButton: (context) async {
|
||||
final domain = widget.exchangeViewModel.depositAddress;
|
||||
widget.exchangeViewModel.depositAddress =
|
||||
await fetchParsedAddress(context, domain,
|
||||
widget.exchangeViewModel.depositCurrency);
|
||||
},
|
||||
),
|
||||
ModernButton.svg(
|
||||
size: 36,
|
||||
iconSize: 24,
|
||||
svgPath: "assets/new-ui/swap_amounts.svg",
|
||||
onPressed: widget.exchangeViewModel.reverseSwapDirection,
|
||||
),
|
||||
SwapLimitPopup(exchangeViewModel: widget.exchangeViewModel),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 12.0),
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Container(
|
||||
height: 1,
|
||||
width: double.infinity,
|
||||
color: Theme.of(context).colorScheme.surfaceContainerHigh,
|
||||
),
|
||||
ModernButton.svg(
|
||||
size: 36,
|
||||
iconSize: 24,
|
||||
svgPath: "assets/new-ui/swap_amounts.svg",
|
||||
onPressed: widget.exchangeViewModel.reverseSwapDirection,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Observer(
|
||||
builder: (_) => SwapAmountBox(
|
||||
isReceiverCard: true,
|
||||
walletSwitcherViewModel: widget.walletSwitcherViewModel,
|
||||
exchangeViewModel: widget.exchangeViewModel,
|
||||
onDispose: disposeBestRateSync,
|
||||
key: receiveKey,
|
||||
title: S.of(context).receive,
|
||||
initialCurrency: widget.exchangeViewModel.receiveCurrency,
|
||||
currencies: widget.exchangeViewModel.receiveCurrencies,
|
||||
onCurrencySelected: (currency) {
|
||||
if (currency is CryptoCurrency) {
|
||||
widget.exchangeViewModel
|
||||
.changeReceiveCurrency(currency: currency);
|
||||
}
|
||||
},
|
||||
currencyValueValidator: (value) {
|
||||
return widget.exchangeViewModel.isFixedRateMode
|
||||
? AmountValidator(
|
||||
isAutovalidate: true,
|
||||
currency: widget.exchangeViewModel.receiveCurrency,
|
||||
minValue: widget.exchangeViewModel.limits.min.toString(),
|
||||
maxValue: widget.exchangeViewModel.limits.max.toString(),
|
||||
amountParsingProxy:
|
||||
widget.exchangeViewModel.amountParsingProxy,
|
||||
).call(value)
|
||||
: null;
|
||||
},
|
||||
addressTextFieldValidator: AddressValidator(
|
||||
type: widget.exchangeViewModel.receiveCurrency),
|
||||
onPushPasteButton: (context) async {
|
||||
final clipboard = await Clipboard.getData('text/plain');
|
||||
widget.exchangeViewModel.receiveAddress = clipboard?.text ?? '';
|
||||
),
|
||||
Observer(
|
||||
builder: (_) => SwapAmountBox(
|
||||
isReceiverCard: true,
|
||||
walletSwitcherViewModel: widget.walletSwitcherViewModel,
|
||||
exchangeViewModel: widget.exchangeViewModel,
|
||||
onDispose: disposeBestRateSync,
|
||||
key: receiveKey,
|
||||
title: S.of(context).receive,
|
||||
initialCurrency: widget.exchangeViewModel.receiveCurrency,
|
||||
currencies: widget.exchangeViewModel.receiveCurrencies,
|
||||
onCurrencySelected: (currency) {
|
||||
if (currency is CryptoCurrency) {
|
||||
widget.exchangeViewModel
|
||||
.changeReceiveCurrency(currency: currency);
|
||||
}
|
||||
},
|
||||
currencyValueValidator: (value) {
|
||||
return widget.exchangeViewModel.isFixedRateMode
|
||||
? AmountValidator(
|
||||
isAutovalidate: true,
|
||||
currency: widget.exchangeViewModel.receiveCurrency,
|
||||
minValue: widget.exchangeViewModel.limits.min.toString(),
|
||||
maxValue: widget.exchangeViewModel.limits.max.toString(),
|
||||
amountParsingProxy:
|
||||
widget.exchangeViewModel.amountParsingProxy,
|
||||
).call(value)
|
||||
: null;
|
||||
},
|
||||
addressTextFieldValidator: AddressValidator(
|
||||
type: widget.exchangeViewModel.receiveCurrency),
|
||||
onPushPasteButton: (context) async {
|
||||
final clipboard = await Clipboard.getData('text/plain');
|
||||
widget.exchangeViewModel.receiveAddress = clipboard?.text ?? '';
|
||||
|
||||
final domain = widget.exchangeViewModel.receiveAddress;
|
||||
widget.exchangeViewModel.receiveAddress =
|
||||
await fetchParsedAddress(context, domain,
|
||||
widget.exchangeViewModel.receiveCurrency);
|
||||
},
|
||||
onPushAddressBookButton: (context) async {
|
||||
final domain = widget.exchangeViewModel.receiveAddress;
|
||||
widget.exchangeViewModel.receiveAddress =
|
||||
await fetchParsedAddress(context, domain,
|
||||
widget.exchangeViewModel.receiveCurrency);
|
||||
},
|
||||
),
|
||||
)
|
||||
],
|
||||
final domain = widget.exchangeViewModel.receiveAddress;
|
||||
widget.exchangeViewModel.receiveAddress =
|
||||
await fetchParsedAddress(context, domain,
|
||||
widget.exchangeViewModel.receiveCurrency);
|
||||
},
|
||||
onPushAddressBookButton: (context) async {
|
||||
final domain = widget.exchangeViewModel.receiveAddress;
|
||||
widget.exchangeViewModel.receiveAddress =
|
||||
await fetchParsedAddress(context, domain,
|
||||
widget.exchangeViewModel.receiveCurrency);
|
||||
},
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -6,15 +6,19 @@ import 'package:cake_wallet/generated/i18n.dart';
|
||||
import 'package:cake_wallet/new-ui/modal_navigator.dart';
|
||||
import 'package:cake_wallet/new-ui/pages/send_page.dart';
|
||||
import 'package:cake_wallet/new-ui/pages/swap_page.dart';
|
||||
import 'package:cake_wallet/reactions/wallet_connect.dart';
|
||||
import 'package:cake_wallet/routes.dart';
|
||||
import 'package:cake_wallet/src/widgets/alert_with_one_action.dart';
|
||||
import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
|
||||
import 'package:cake_wallet/utils/feature_flag.dart';
|
||||
import 'package:cake_wallet/utils/payment_request.dart';
|
||||
import 'package:cake_wallet/utils/show_pop_up.dart';
|
||||
import 'package:cake_wallet/view_model/send/send_view_model.dart';
|
||||
import 'package:cake_wallet/view_model/wallet_address_list/wallet_address_list_view_model.dart';
|
||||
import 'package:cw_core/crypto_currency.dart';
|
||||
import 'package:cw_core/lnurl.dart';
|
||||
import 'package:cw_core/unspent_coin_type.dart';
|
||||
import 'package:cw_core/wallet_type.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:modal_bottom_sheet/modal_bottom_sheet.dart';
|
||||
@@ -24,10 +28,11 @@ import '../../../pages/scan_page.dart';
|
||||
import 'coin_action_button.dart';
|
||||
|
||||
class CoinActionRow extends StatelessWidget {
|
||||
const CoinActionRow({super.key, this.lightningMode = false, this.showSwap = true});
|
||||
const CoinActionRow({super.key, this.lightningMode = false, this.showSwap = true, required this.walletType});
|
||||
|
||||
final bool lightningMode;
|
||||
final bool showSwap;
|
||||
final WalletType walletType;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -178,6 +183,21 @@ class CoinActionRow extends StatelessWidget {
|
||||
req = PaymentRequest(code, amount, "", "", "");
|
||||
} else if (OpenCryptoPayService.isOpenCryptoPayQR(code)) {
|
||||
req = PaymentRequest(code, "", "", "", "");
|
||||
} else if (Uri.tryParse(code)?.scheme == "wc") {
|
||||
if (!isEVMCompatibleChain(walletType)) {
|
||||
showPopUp<void>(
|
||||
context: context,
|
||||
builder: (context) => AlertWithOneAction(
|
||||
alertTitle: "WalletConnect",
|
||||
alertContent: S.of(context).switchToEVMCompatibleWallet,
|
||||
buttonText: "OK",
|
||||
buttonAction: Navigator.of(context).pop));
|
||||
return;
|
||||
}
|
||||
|
||||
Navigator.of(context)
|
||||
.pushNamed(Routes.walletConnectConnectionsListing, arguments: Uri.parse(code));
|
||||
return;
|
||||
} else {
|
||||
final uri = Uri.tryParse(code);
|
||||
if (uri == null) return;
|
||||
|
||||
@@ -202,9 +202,19 @@ class SwapTransactionDetails extends StatelessWidget {
|
||||
label: exchangeTradeViewModel.trade.provider.title,
|
||||
iconPath: exchangeTradeViewModel.trade.provider.image,
|
||||
trailingIconPath: "assets/new-ui/copy.svg",
|
||||
trailingText: exchangeTradeViewModel.trade.id,
|
||||
truncateTrailingText:
|
||||
!exchangeTradeViewModel.trade.provider.isCentralized),
|
||||
trailingText: exchangeTradeViewModel.trade.id.toString().length > 18
|
||||
? null
|
||||
: exchangeTradeViewModel.trade.id,
|
||||
bottomWidget: exchangeTradeViewModel.trade.id.toString().length <= 18
|
||||
? null
|
||||
: Padding(
|
||||
padding: const EdgeInsets.only(top: 12.0),
|
||||
child: Text(
|
||||
exchangeTradeViewModel.trade.id,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant),
|
||||
),
|
||||
)),
|
||||
if (exchangeTradeViewModel.trade.provider ==
|
||||
ExchangeProviderDescription.trocador)
|
||||
ListItemRegularRow(
|
||||
|
||||
@@ -12,6 +12,7 @@ import 'package:cake_wallet/entities/qr_scanner.dart';
|
||||
import 'package:cake_wallet/src/widgets/primary_button.dart';
|
||||
import 'package:cake_wallet/utils/show_pop_up.dart';
|
||||
import 'package:cake_wallet/utils/permission_handler.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
import 'widgets/wc_pairing_item_widget.dart';
|
||||
import 'wc_pairing_detail_page.dart';
|
||||
@@ -27,6 +28,11 @@ class WalletConnectConnectionsView extends StatelessWidget {
|
||||
void _triggerPairingFromDeeplink(Uri? launchUri) async {
|
||||
if (launchUri == null) return;
|
||||
|
||||
if(launchUri.scheme == "wc") {
|
||||
await walletKitService.pairWithUri(launchUri);
|
||||
return;
|
||||
}
|
||||
|
||||
final actualLinkList = launchUri.query.split("uri=");
|
||||
|
||||
if (actualLinkList.length <= 1) return;
|
||||
|
||||
@@ -84,6 +84,8 @@ class WalletUnlockPageState extends AuthPageState<WalletUnlockPage> {
|
||||
_passwordController.removeListener(_passwordControllerListener!);
|
||||
}
|
||||
|
||||
_passwordController.dispose();
|
||||
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@@ -105,6 +107,26 @@ class WalletUnlockPageState extends AuthPageState<WalletUnlockPage> {
|
||||
});
|
||||
}
|
||||
|
||||
Future<void> _unlockWallet() async {
|
||||
if (widget.walletUnlockViewModel.state is IsExecutingState) {
|
||||
return;
|
||||
}
|
||||
|
||||
FocusScope.of(context).unfocus();
|
||||
|
||||
if (widget.authPasswordHandler != null) {
|
||||
try {
|
||||
await widget.authPasswordHandler!(widget.walletUnlockViewModel.password);
|
||||
widget.walletUnlockViewModel.success();
|
||||
} catch (e) {
|
||||
widget.walletUnlockViewModel.failure(e);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
await widget.walletUnlockViewModel.unlock();
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> close({String? route, arguments}) async {
|
||||
if (_key.currentContext == null) {
|
||||
@@ -176,6 +198,9 @@ class WalletUnlockPageState extends AuthPageState<WalletUnlockPage> {
|
||||
child: BaseTextFormField(
|
||||
key: ValueKey('enter_wallet_password'),
|
||||
onChanged: (value) => null,
|
||||
onSubmit: (_) async {
|
||||
await _unlockWallet();
|
||||
},
|
||||
controller: _passwordController,
|
||||
textAlign: TextAlign.center,
|
||||
obscureText: true,
|
||||
@@ -187,7 +212,7 @@ class WalletUnlockPageState extends AuthPageState<WalletUnlockPage> {
|
||||
fontSize: 18.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
hintText: S.of(context).enter_wallet_password,
|
||||
),
|
||||
),
|
||||
@@ -199,19 +224,7 @@ class WalletUnlockPageState extends AuthPageState<WalletUnlockPage> {
|
||||
padding: EdgeInsets.only(bottom: 24),
|
||||
child: Observer(
|
||||
builder: (_) => LoadingPrimaryButton(
|
||||
onPressed: () async {
|
||||
if (widget.authPasswordHandler != null) {
|
||||
try {
|
||||
await widget.authPasswordHandler!(widget.walletUnlockViewModel.password);
|
||||
widget.walletUnlockViewModel.success();
|
||||
} catch (e) {
|
||||
widget.walletUnlockViewModel.failure(e);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
widget.walletUnlockViewModel.unlock();
|
||||
},
|
||||
onPressed: _unlockWallet,
|
||||
text: S.of(context).unlock,
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
textColor: Theme.of(context).colorScheme.onPrimary,
|
||||
|
||||
@@ -121,7 +121,7 @@ class BaseTextFormField extends StatelessWidget {
|
||||
inputFormatters: inputFormatters,
|
||||
enabled: enabled,
|
||||
maxLength: maxLength,
|
||||
onFieldSubmitted: onSubmit,
|
||||
onFieldSubmitted: onFieldSubmitted ?? onSubmit,
|
||||
style: textStyle ??
|
||||
Theme.of(context).textTheme.bodyMedium!.copyWith(
|
||||
fontSize: 16.0, color: textColor ?? Theme.of(context).colorScheme.onSurface),
|
||||
|
||||
@@ -129,9 +129,10 @@ abstract class UnspentCoinsListViewModelBase with Store {
|
||||
existingInfo.note = item.note;
|
||||
|
||||
await existingInfo.save();
|
||||
await _updateUnspents();
|
||||
await wallet.updateBalance();
|
||||
item.isBeingSaved = false;
|
||||
isSavingItems = false;
|
||||
_updateUnspentCoinsInfo();
|
||||
} catch (e) {
|
||||
printV('Error saving coin info: $e');
|
||||
item.isBeingSaved = false;
|
||||
|
||||
Reference in New Issue
Block a user