mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-03-21 22:58:49 +00:00
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:
parent
32299975c3
commit
5f71a1c2dd
8 changed files with 94 additions and 63 deletions
|
@ -322,12 +322,17 @@ class _RestoreOptionsViewState extends ConsumerState<RestoreOptionsView> {
|
||||||
onTap: chooseDate,
|
onTap: chooseDate,
|
||||||
controller: _dateController,
|
controller: _dateController,
|
||||||
),
|
),
|
||||||
if (isDesktop)
|
if (coin == Coin.monero ||
|
||||||
// TODO desktop date picker
|
coin == Coin.epicCash ||
|
||||||
RestoreFromDatePicker(
|
(coin == Coin.wownero &&
|
||||||
onTap: chooseDesktopDate,
|
ref.watch(mnemonicWordCountStateProvider.state).state ==
|
||||||
controller: _dateController,
|
25))
|
||||||
),
|
if (isDesktop)
|
||||||
|
// TODO desktop date picker
|
||||||
|
RestoreFromDatePicker(
|
||||||
|
onTap: chooseDesktopDate,
|
||||||
|
controller: _dateController,
|
||||||
|
),
|
||||||
if (coin == Coin.monero ||
|
if (coin == Coin.monero ||
|
||||||
coin == Coin.epicCash ||
|
coin == Coin.epicCash ||
|
||||||
(coin == Coin.wownero &&
|
(coin == Coin.wownero &&
|
||||||
|
|
|
@ -409,8 +409,9 @@ class _GenerateUriQrCodeViewState extends State<GenerateUriQrCodeView> {
|
||||||
height: 1.8,
|
height: 1.8,
|
||||||
)
|
)
|
||||||
: STextStyles.field(context),
|
: STextStyles.field(context),
|
||||||
keyboardType:
|
keyboardType: Util.isDesktop
|
||||||
const TextInputType.numberWithOptions(decimal: true),
|
? null
|
||||||
|
: const TextInputType.numberWithOptions(decimal: true),
|
||||||
onChanged: (_) => setState(() {}),
|
onChanged: (_) => setState(() {}),
|
||||||
decoration: standardInputDecoration(
|
decoration: standardInputDecoration(
|
||||||
"Amount",
|
"Amount",
|
||||||
|
|
|
@ -1111,10 +1111,12 @@ class _SendViewState extends ConsumerState<SendView> {
|
||||||
const Key("amountInputFieldCryptoTextFieldKey"),
|
const Key("amountInputFieldCryptoTextFieldKey"),
|
||||||
controller: cryptoAmountController,
|
controller: cryptoAmountController,
|
||||||
focusNode: _cryptoFocus,
|
focusNode: _cryptoFocus,
|
||||||
keyboardType: const TextInputType.numberWithOptions(
|
keyboardType: Util.isDesktop
|
||||||
signed: false,
|
? null
|
||||||
decimal: true,
|
: const TextInputType.numberWithOptions(
|
||||||
),
|
signed: false,
|
||||||
|
decimal: true,
|
||||||
|
),
|
||||||
textAlign: TextAlign.right,
|
textAlign: TextAlign.right,
|
||||||
inputFormatters: [
|
inputFormatters: [
|
||||||
// regex to validate a crypto amount with 8 decimal places
|
// regex to validate a crypto amount with 8 decimal places
|
||||||
|
@ -1168,11 +1170,12 @@ class _SendViewState extends ConsumerState<SendView> {
|
||||||
const Key("amountInputFieldFiatTextFieldKey"),
|
const Key("amountInputFieldFiatTextFieldKey"),
|
||||||
controller: baseAmountController,
|
controller: baseAmountController,
|
||||||
focusNode: _baseFocus,
|
focusNode: _baseFocus,
|
||||||
keyboardType:
|
keyboardType: Util.isDesktop
|
||||||
const TextInputType.numberWithOptions(
|
? null
|
||||||
signed: false,
|
: const TextInputType.numberWithOptions(
|
||||||
decimal: true,
|
signed: false,
|
||||||
),
|
decimal: true,
|
||||||
|
),
|
||||||
textAlign: TextAlign.right,
|
textAlign: TextAlign.right,
|
||||||
inputFormatters: [
|
inputFormatters: [
|
||||||
// regex to validate a fiat amount with 2 decimal places
|
// regex to validate a fiat amount with 2 decimal places
|
||||||
|
|
|
@ -391,7 +391,8 @@ class _EpiBoxInfoFormState extends ConsumerState<EpicBoxInfoForm> {
|
||||||
enableSuggestions: Util.isDesktop ? false : true,
|
enableSuggestions: Util.isDesktop ? false : true,
|
||||||
controller: portController,
|
controller: portController,
|
||||||
decoration: const InputDecoration(hintText: "Port"),
|
decoration: const InputDecoration(hintText: "Port"),
|
||||||
keyboardType: const TextInputType.numberWithOptions(),
|
keyboardType:
|
||||||
|
Util.isDesktop ? null : const TextInputType.numberWithOptions(),
|
||||||
),
|
),
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 8,
|
height: 8,
|
||||||
|
|
|
@ -739,10 +739,12 @@ class _TransactionSearchViewState
|
||||||
controller: _amountTextEditingController,
|
controller: _amountTextEditingController,
|
||||||
focusNode: amountTextFieldFocusNode,
|
focusNode: amountTextFieldFocusNode,
|
||||||
onChanged: (_) => setState(() {}),
|
onChanged: (_) => setState(() {}),
|
||||||
keyboardType: const TextInputType.numberWithOptions(
|
keyboardType: Util.isDesktop
|
||||||
signed: false,
|
? null
|
||||||
decimal: true,
|
: const TextInputType.numberWithOptions(
|
||||||
),
|
signed: false,
|
||||||
|
decimal: true,
|
||||||
|
),
|
||||||
inputFormatters: [
|
inputFormatters: [
|
||||||
// regex to validate a crypto amount with 8 decimal places
|
// regex to validate a crypto amount with 8 decimal places
|
||||||
TextInputFormatter.withFunction((oldValue, newValue) =>
|
TextInputFormatter.withFunction((oldValue, newValue) =>
|
||||||
|
|
|
@ -42,6 +42,9 @@ class _ContactListItemState extends ConsumerState<ContactListItem> {
|
||||||
final contact = ref.watch(addressBookServiceProvider
|
final contact = ref.watch(addressBookServiceProvider
|
||||||
.select((value) => value.getContactById(contactId)));
|
.select((value) => value.getContactById(contactId)));
|
||||||
|
|
||||||
|
// hack fix until we use a proper database (not Hive)
|
||||||
|
int i = 0;
|
||||||
|
|
||||||
return RoundedWhiteContainer(
|
return RoundedWhiteContainer(
|
||||||
padding: const EdgeInsets.all(0),
|
padding: const EdgeInsets.all(0),
|
||||||
borderColor: Theme.of(context).extension<StackColors>()!.background,
|
borderColor: Theme.of(context).extension<StackColors>()!.background,
|
||||||
|
@ -70,7 +73,8 @@ class _ContactListItemState extends ConsumerState<ContactListItem> {
|
||||||
filterByCoin != null ? e.coin == filterByCoin! : true)
|
filterByCoin != null ? e.coin == filterByCoin! : true)
|
||||||
.map(
|
.map(
|
||||||
(e) => Column(
|
(e) => Column(
|
||||||
key: Key("contactAddress_${e.address}_${e.label}_key"),
|
key: Key(
|
||||||
|
"contactAddress_${e.address}_${e.label}_${++i}_key"),
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
|
|
|
@ -140,17 +140,21 @@ class _DesktopSendState extends ConsumerState<DesktopSend> {
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 40,
|
height: 40,
|
||||||
),
|
),
|
||||||
Padding(
|
Row(
|
||||||
padding: const EdgeInsets.only(
|
children: [
|
||||||
right: 32,
|
Expanded(
|
||||||
),
|
child: SecondaryButton(
|
||||||
child: SecondaryButton(
|
buttonHeight: ButtonHeight.l,
|
||||||
buttonHeight: ButtonHeight.l,
|
label: "Ok",
|
||||||
label: "Ok",
|
onPressed: () {
|
||||||
onPressed: () {
|
Navigator.of(context).pop();
|
||||||
Navigator.of(context).pop();
|
},
|
||||||
},
|
),
|
||||||
),
|
),
|
||||||
|
const SizedBox(
|
||||||
|
width: 32,
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
@ -319,13 +323,13 @@ class _DesktopSendState extends ConsumerState<DesktopSend> {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!wasCancelled && mounted) {
|
if (!wasCancelled && mounted) {
|
||||||
|
txData["note"] = _note ?? "";
|
||||||
|
txData["address"] = _address;
|
||||||
// pop building dialog
|
// pop building dialog
|
||||||
Navigator.of(
|
Navigator.of(
|
||||||
context,
|
context,
|
||||||
rootNavigator: true,
|
rootNavigator: true,
|
||||||
).pop();
|
).pop();
|
||||||
txData["note"] = _note;
|
|
||||||
txData["address"] = _address;
|
|
||||||
|
|
||||||
unawaited(
|
unawaited(
|
||||||
showDialog(
|
showDialog(
|
||||||
|
@ -394,22 +398,24 @@ class _DesktopSendState extends ConsumerState<DesktopSend> {
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 40,
|
height: 40,
|
||||||
),
|
),
|
||||||
Padding(
|
Row(
|
||||||
padding: const EdgeInsets.only(
|
children: [
|
||||||
right: 32,
|
Expanded(
|
||||||
),
|
child: SecondaryButton(
|
||||||
child: Expanded(
|
buttonHeight: ButtonHeight.l,
|
||||||
child: SecondaryButton(
|
label: "Ok",
|
||||||
buttonHeight: ButtonHeight.l,
|
onPressed: () {
|
||||||
label: "Yes",
|
Navigator.of(
|
||||||
onPressed: () {
|
context,
|
||||||
Navigator.of(
|
rootNavigator: true,
|
||||||
context,
|
).pop();
|
||||||
rootNavigator: true,
|
},
|
||||||
).pop();
|
),
|
||||||
},
|
|
||||||
),
|
),
|
||||||
),
|
const SizedBox(
|
||||||
|
width: 32,
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
@ -1002,10 +1008,12 @@ class _DesktopSendState extends ConsumerState<DesktopSend> {
|
||||||
key: const Key("amountInputFieldCryptoTextFieldKey"),
|
key: const Key("amountInputFieldCryptoTextFieldKey"),
|
||||||
controller: cryptoAmountController,
|
controller: cryptoAmountController,
|
||||||
focusNode: _cryptoFocus,
|
focusNode: _cryptoFocus,
|
||||||
keyboardType: const TextInputType.numberWithOptions(
|
keyboardType: Util.isDesktop
|
||||||
signed: false,
|
? null
|
||||||
decimal: true,
|
: const TextInputType.numberWithOptions(
|
||||||
),
|
signed: false,
|
||||||
|
decimal: true,
|
||||||
|
),
|
||||||
textAlign: TextAlign.right,
|
textAlign: TextAlign.right,
|
||||||
inputFormatters: [
|
inputFormatters: [
|
||||||
// regex to validate a crypto amount with 8 decimal places
|
// regex to validate a crypto amount with 8 decimal places
|
||||||
|
@ -1056,10 +1064,12 @@ class _DesktopSendState extends ConsumerState<DesktopSend> {
|
||||||
key: const Key("amountInputFieldFiatTextFieldKey"),
|
key: const Key("amountInputFieldFiatTextFieldKey"),
|
||||||
controller: baseAmountController,
|
controller: baseAmountController,
|
||||||
focusNode: _baseFocus,
|
focusNode: _baseFocus,
|
||||||
keyboardType: const TextInputType.numberWithOptions(
|
keyboardType: Util.isDesktop
|
||||||
signed: false,
|
? null
|
||||||
decimal: true,
|
: const TextInputType.numberWithOptions(
|
||||||
),
|
signed: false,
|
||||||
|
decimal: true,
|
||||||
|
),
|
||||||
textAlign: TextAlign.right,
|
textAlign: TextAlign.right,
|
||||||
inputFormatters: [
|
inputFormatters: [
|
||||||
// regex to validate a fiat amount with 2 decimal places
|
// regex to validate a fiat amount with 2 decimal places
|
||||||
|
|
|
@ -4,6 +4,7 @@ import 'package:flutter_svg/svg.dart';
|
||||||
import 'package:stackwallet/utilities/assets.dart';
|
import 'package:stackwallet/utilities/assets.dart';
|
||||||
import 'package:stackwallet/utilities/text_styles.dart';
|
import 'package:stackwallet/utilities/text_styles.dart';
|
||||||
import 'package:stackwallet/utilities/theme/stack_colors.dart';
|
import 'package:stackwallet/utilities/theme/stack_colors.dart';
|
||||||
|
import 'package:stackwallet/utilities/util.dart';
|
||||||
import 'package:stackwallet/widgets/loading_indicator.dart';
|
import 'package:stackwallet/widgets/loading_indicator.dart';
|
||||||
|
|
||||||
class ExchangeTextField extends StatefulWidget {
|
class ExchangeTextField extends StatefulWidget {
|
||||||
|
@ -62,6 +63,8 @@ class _ExchangeTextFieldState extends State<ExchangeTextField> {
|
||||||
late final void Function(String)? onChanged;
|
late final void Function(String)? onChanged;
|
||||||
late final void Function(String)? onSubmitted;
|
late final void Function(String)? onSubmitted;
|
||||||
|
|
||||||
|
final isDesktop = Util.isDesktop;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
borderRadius = widget.borderRadius;
|
borderRadius = widget.borderRadius;
|
||||||
|
@ -100,10 +103,12 @@ class _ExchangeTextFieldState extends State<ExchangeTextField> {
|
||||||
enableSuggestions: false,
|
enableSuggestions: false,
|
||||||
autocorrect: false,
|
autocorrect: false,
|
||||||
readOnly: widget.readOnly,
|
readOnly: widget.readOnly,
|
||||||
keyboardType: const TextInputType.numberWithOptions(
|
keyboardType: isDesktop
|
||||||
signed: false,
|
? null
|
||||||
decimal: true,
|
: const TextInputType.numberWithOptions(
|
||||||
),
|
signed: false,
|
||||||
|
decimal: true,
|
||||||
|
),
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
contentPadding: const EdgeInsets.only(
|
contentPadding: const EdgeInsets.only(
|
||||||
top: 12,
|
top: 12,
|
||||||
|
|
Loading…
Reference in a new issue