more bug fixes (#281)

* xmr send fix

* small screen recovery phrase warning view fix

* mnemonic field crashes fix

* desktop restore date fix

* mac desktop keyboard type crash fix

* firo (and possibly other) send fix

* key fix for duplicate wallets edge case
This commit is contained in:
julian-CStack 2022-12-30 17:10:25 -06:00 committed by GitHub
parent 32299975c3
commit 5f71a1c2dd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 94 additions and 63 deletions

View file

@ -322,6 +322,11 @@ class _RestoreOptionsViewState extends ConsumerState<RestoreOptionsView> {
onTap: chooseDate,
controller: _dateController,
),
if (coin == Coin.monero ||
coin == Coin.epicCash ||
(coin == Coin.wownero &&
ref.watch(mnemonicWordCountStateProvider.state).state ==
25))
if (isDesktop)
// TODO desktop date picker
RestoreFromDatePicker(

View file

@ -409,8 +409,9 @@ class _GenerateUriQrCodeViewState extends State<GenerateUriQrCodeView> {
height: 1.8,
)
: STextStyles.field(context),
keyboardType:
const TextInputType.numberWithOptions(decimal: true),
keyboardType: Util.isDesktop
? null
: const TextInputType.numberWithOptions(decimal: true),
onChanged: (_) => setState(() {}),
decoration: standardInputDecoration(
"Amount",

View file

@ -1111,7 +1111,9 @@ class _SendViewState extends ConsumerState<SendView> {
const Key("amountInputFieldCryptoTextFieldKey"),
controller: cryptoAmountController,
focusNode: _cryptoFocus,
keyboardType: const TextInputType.numberWithOptions(
keyboardType: Util.isDesktop
? null
: const TextInputType.numberWithOptions(
signed: false,
decimal: true,
),
@ -1168,8 +1170,9 @@ class _SendViewState extends ConsumerState<SendView> {
const Key("amountInputFieldFiatTextFieldKey"),
controller: baseAmountController,
focusNode: _baseFocus,
keyboardType:
const TextInputType.numberWithOptions(
keyboardType: Util.isDesktop
? null
: const TextInputType.numberWithOptions(
signed: false,
decimal: true,
),

View file

@ -391,7 +391,8 @@ class _EpiBoxInfoFormState extends ConsumerState<EpicBoxInfoForm> {
enableSuggestions: Util.isDesktop ? false : true,
controller: portController,
decoration: const InputDecoration(hintText: "Port"),
keyboardType: const TextInputType.numberWithOptions(),
keyboardType:
Util.isDesktop ? null : const TextInputType.numberWithOptions(),
),
const SizedBox(
height: 8,

View file

@ -739,7 +739,9 @@ class _TransactionSearchViewState
controller: _amountTextEditingController,
focusNode: amountTextFieldFocusNode,
onChanged: (_) => setState(() {}),
keyboardType: const TextInputType.numberWithOptions(
keyboardType: Util.isDesktop
? null
: const TextInputType.numberWithOptions(
signed: false,
decimal: true,
),

View file

@ -42,6 +42,9 @@ class _ContactListItemState extends ConsumerState<ContactListItem> {
final contact = ref.watch(addressBookServiceProvider
.select((value) => value.getContactById(contactId)));
// hack fix until we use a proper database (not Hive)
int i = 0;
return RoundedWhiteContainer(
padding: const EdgeInsets.all(0),
borderColor: Theme.of(context).extension<StackColors>()!.background,
@ -70,7 +73,8 @@ class _ContactListItemState extends ConsumerState<ContactListItem> {
filterByCoin != null ? e.coin == filterByCoin! : true)
.map(
(e) => Column(
key: Key("contactAddress_${e.address}_${e.label}_key"),
key: Key(
"contactAddress_${e.address}_${e.label}_${++i}_key"),
mainAxisSize: MainAxisSize.min,
children: [
Container(

View file

@ -140,10 +140,9 @@ class _DesktopSendState extends ConsumerState<DesktopSend> {
const SizedBox(
height: 40,
),
Padding(
padding: const EdgeInsets.only(
right: 32,
),
Row(
children: [
Expanded(
child: SecondaryButton(
buttonHeight: ButtonHeight.l,
label: "Ok",
@ -152,6 +151,11 @@ class _DesktopSendState extends ConsumerState<DesktopSend> {
},
),
),
const SizedBox(
width: 32,
),
],
),
],
),
),
@ -319,13 +323,13 @@ class _DesktopSendState extends ConsumerState<DesktopSend> {
}
if (!wasCancelled && mounted) {
txData["note"] = _note ?? "";
txData["address"] = _address;
// pop building dialog
Navigator.of(
context,
rootNavigator: true,
).pop();
txData["note"] = _note;
txData["address"] = _address;
unawaited(
showDialog(
@ -394,14 +398,12 @@ class _DesktopSendState extends ConsumerState<DesktopSend> {
const SizedBox(
height: 40,
),
Padding(
padding: const EdgeInsets.only(
right: 32,
),
child: Expanded(
Row(
children: [
Expanded(
child: SecondaryButton(
buttonHeight: ButtonHeight.l,
label: "Yes",
label: "Ok",
onPressed: () {
Navigator.of(
context,
@ -410,6 +412,10 @@ class _DesktopSendState extends ConsumerState<DesktopSend> {
},
),
),
const SizedBox(
width: 32,
),
],
),
],
),
@ -1002,7 +1008,9 @@ class _DesktopSendState extends ConsumerState<DesktopSend> {
key: const Key("amountInputFieldCryptoTextFieldKey"),
controller: cryptoAmountController,
focusNode: _cryptoFocus,
keyboardType: const TextInputType.numberWithOptions(
keyboardType: Util.isDesktop
? null
: const TextInputType.numberWithOptions(
signed: false,
decimal: true,
),
@ -1056,7 +1064,9 @@ class _DesktopSendState extends ConsumerState<DesktopSend> {
key: const Key("amountInputFieldFiatTextFieldKey"),
controller: baseAmountController,
focusNode: _baseFocus,
keyboardType: const TextInputType.numberWithOptions(
keyboardType: Util.isDesktop
? null
: const TextInputType.numberWithOptions(
signed: false,
decimal: true,
),

View file

@ -4,6 +4,7 @@ import 'package:flutter_svg/svg.dart';
import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/utilities/util.dart';
import 'package:stackwallet/widgets/loading_indicator.dart';
class ExchangeTextField extends StatefulWidget {
@ -62,6 +63,8 @@ class _ExchangeTextFieldState extends State<ExchangeTextField> {
late final void Function(String)? onChanged;
late final void Function(String)? onSubmitted;
final isDesktop = Util.isDesktop;
@override
void initState() {
borderRadius = widget.borderRadius;
@ -100,7 +103,9 @@ class _ExchangeTextFieldState extends State<ExchangeTextField> {
enableSuggestions: false,
autocorrect: false,
readOnly: widget.readOnly,
keyboardType: const TextInputType.numberWithOptions(
keyboardType: isDesktop
? null
: const TextInputType.numberWithOptions(
signed: false,
decimal: true,
),