mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-03-22 23:28:53 +00:00
Merge branch 'main' of github.com:cake-tech/cake_wallet into hv
This commit is contained in:
commit
64936f3a03
2 changed files with 50 additions and 2 deletions
|
@ -2,6 +2,7 @@ import 'package:cake_wallet/src/widgets/keyboard_done_button.dart';
|
||||||
import 'package:cake_wallet/themes/theme_base.dart';
|
import 'package:cake_wallet/themes/theme_base.dart';
|
||||||
import 'package:cake_wallet/utils/show_pop_up.dart';
|
import 'package:cake_wallet/utils/show_pop_up.dart';
|
||||||
import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart';
|
import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart';
|
||||||
|
import 'package:cw_core/wallet_type.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter_mobx/flutter_mobx.dart';
|
import 'package:flutter_mobx/flutter_mobx.dart';
|
||||||
|
@ -108,7 +109,8 @@ class ReceivePage extends BasePage {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget body(BuildContext context) {
|
Widget body(BuildContext context) {
|
||||||
return KeyboardActions(
|
return addressListViewModel.type == WalletType.monero
|
||||||
|
? KeyboardActions(
|
||||||
config: KeyboardActionsConfig(
|
config: KeyboardActionsConfig(
|
||||||
keyboardActionsPlatform: KeyboardActionsPlatform.IOS,
|
keyboardActionsPlatform: KeyboardActionsPlatform.IOS,
|
||||||
keyboardBarColor: Theme.of(context).accentTextTheme.body2
|
keyboardBarColor: Theme.of(context).accentTextTheme.body2
|
||||||
|
@ -210,6 +212,32 @@ class ReceivePage extends BasePage {
|
||||||
})),
|
})),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
));
|
)) : Padding(
|
||||||
|
padding: EdgeInsets.fromLTRB(24, 24, 24, 32),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
flex: 7,
|
||||||
|
child: QRWidget(
|
||||||
|
addressListViewModel: addressListViewModel,
|
||||||
|
isAmountFieldShow: true,
|
||||||
|
amountTextFieldFocusNode: _cryptoAmountFocus,
|
||||||
|
isLight: currentTheme.type == ThemeType.light),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
flex: 2,
|
||||||
|
child: SizedBox(),
|
||||||
|
),
|
||||||
|
Text(S.of(context).electrum_address_disclaimer,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 15,
|
||||||
|
color: Theme.of(context)
|
||||||
|
.accentTextTheme
|
||||||
|
.display2
|
||||||
|
.backgroundColor)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,6 +77,22 @@ class BitcoinURI extends PaymentURI {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class LitecoinURI extends PaymentURI {
|
||||||
|
LitecoinURI({String amount, String address})
|
||||||
|
: super(amount: amount, address: address);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
var base = 'litecoin:' + address;
|
||||||
|
|
||||||
|
if (amount?.isNotEmpty ?? false) {
|
||||||
|
base += '?amount=${amount.replaceAll(',', '.')}';
|
||||||
|
}
|
||||||
|
|
||||||
|
return base;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
abstract class WalletAddressListViewModelBase with Store {
|
abstract class WalletAddressListViewModelBase with Store {
|
||||||
WalletAddressListViewModelBase({
|
WalletAddressListViewModelBase({
|
||||||
@required AppStore appStore,
|
@required AppStore appStore,
|
||||||
|
@ -142,6 +158,10 @@ abstract class WalletAddressListViewModelBase with Store {
|
||||||
return BitcoinURI(amount: amount, address: address.address);
|
return BitcoinURI(amount: amount, address: address.address);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_wallet.type == WalletType.litecoin) {
|
||||||
|
return LitecoinURI(amount: amount, address: address.address);
|
||||||
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue