mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-24 19:46:16 +00:00
CAKE-222 | fixed transaction priority picker on the send page
This commit is contained in:
parent
9b041dbe1e
commit
68a39bdcfc
3 changed files with 11 additions and 3 deletions
|
@ -746,6 +746,7 @@ class SendPage extends BasePage {
|
||||||
Future<void> _setTransactionPriority(BuildContext context) async {
|
Future<void> _setTransactionPriority(BuildContext context) async {
|
||||||
final items = TransactionPriority.forWalletType(sendViewModel.walletType);
|
final items = TransactionPriority.forWalletType(sendViewModel.walletType);
|
||||||
final selectedItem = items.indexOf(sendViewModel.transactionPriority);
|
final selectedItem = items.indexOf(sendViewModel.transactionPriority);
|
||||||
|
final isShowScrollThumb = items.length > 3;
|
||||||
|
|
||||||
await showPopUp<void>(
|
await showPopUp<void>(
|
||||||
builder: (_) => Picker(
|
builder: (_) => Picker(
|
||||||
|
@ -755,7 +756,7 @@ class SendPage extends BasePage {
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
onItemSelected: (TransactionPriority priority) =>
|
onItemSelected: (TransactionPriority priority) =>
|
||||||
sendViewModel.setTransactionPriority(priority),
|
sendViewModel.setTransactionPriority(priority),
|
||||||
isAlwaysShowScrollThumb: true,
|
isAlwaysShowScrollThumb: isShowScrollThumb,
|
||||||
),
|
),
|
||||||
context: context);
|
context: context);
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,6 +38,13 @@ abstract class SendViewModelBase with Store {
|
||||||
: state = InitialExecutionState(),
|
: state = InitialExecutionState(),
|
||||||
_cryptoNumberFormat = NumberFormat(),
|
_cryptoNumberFormat = NumberFormat(),
|
||||||
sendAll = false {
|
sendAll = false {
|
||||||
|
final _priority = _settingsStore.transactionPriority;
|
||||||
|
|
||||||
|
if (!TransactionPriority.forWalletType(walletType).contains(_priority)) {
|
||||||
|
_settingsStore.transactionPriority =
|
||||||
|
TransactionPriority.forWalletType(walletType).first;
|
||||||
|
}
|
||||||
|
|
||||||
_setCryptoNumMaximumFractionDigits();
|
_setCryptoNumMaximumFractionDigits();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,9 +36,9 @@ abstract class SettingsViewModelBase with Store {
|
||||||
PackageInfo.fromPlatform().then(
|
PackageInfo.fromPlatform().then(
|
||||||
(PackageInfo packageInfo) => currentVersion = packageInfo.version);
|
(PackageInfo packageInfo) => currentVersion = packageInfo.version);
|
||||||
|
|
||||||
final priority = _settingsStore.transactionPriority;
|
final _priority = _settingsStore.transactionPriority;
|
||||||
|
|
||||||
if (!TransactionPriority.forWalletType(_walletType).contains(priority)) {
|
if (!TransactionPriority.forWalletType(_walletType).contains(_priority)) {
|
||||||
_settingsStore.transactionPriority =
|
_settingsStore.transactionPriority =
|
||||||
TransactionPriority.forWalletType(_walletType).first;
|
TransactionPriority.forWalletType(_walletType).first;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue