mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-11-01 09:57:46 +00:00
3006679560
* Change receive screen ui * Upgrade flutter packages * revert Upgrade flutter packages * revert Upgrade flutter packages * Adjust flow for anon invoice page navigation * Add receive screen ui * Implement anonpay invoice * Add invoice detail to transactions page * Implement donation link * Fix transaction filter and details view * Save donation link * Fix transaction display issues * Fix formatting * Fix merge conflict * Fix localization * Fix transaction amount display * Fix transaction limit for fiat * Update fix from code review * Fix issues from code review * Make amountTo nullable to avoid potential * Remove encoding for description in donation link * Remove optional params from request * Fix QR image version * Refactor QRCode, fix issues from code review * Pass version to QRCode full page --------- Co-authored-by: OmarHatem <omarh.ismail1@gmail.com>
34 lines
1 KiB
Dart
34 lines
1 KiB
Dart
import 'package:cake_wallet/entities/receive_page_option.dart';
|
|
import 'package:cw_core/wallet_base.dart';
|
|
import 'package:cw_core/wallet_type.dart';
|
|
import 'package:mobx/mobx.dart';
|
|
|
|
part 'receive_option_view_model.g.dart';
|
|
|
|
class ReceiveOptionViewModel = ReceiveOptionViewModelBase with _$ReceiveOptionViewModel;
|
|
|
|
abstract class ReceiveOptionViewModelBase with Store {
|
|
ReceiveOptionViewModelBase(this._wallet, this.initialPageOption)
|
|
: selectedReceiveOption = initialPageOption ?? ReceivePageOption.mainnet,
|
|
_options = [] {
|
|
final walletType = _wallet.type;
|
|
_options =
|
|
walletType == WalletType.haven ? [ReceivePageOption.mainnet] : ReceivePageOption.values;
|
|
}
|
|
|
|
final WalletBase _wallet;
|
|
|
|
final ReceivePageOption? initialPageOption;
|
|
|
|
List<ReceivePageOption> _options;
|
|
|
|
@observable
|
|
ReceivePageOption selectedReceiveOption;
|
|
|
|
List<ReceivePageOption> get options => _options;
|
|
|
|
@action
|
|
void selectReceiveOption(ReceivePageOption option) {
|
|
selectedReceiveOption = option;
|
|
}
|
|
}
|