No reason to show a selection dialog or even show which coin if its implied in a single coin config.

Addresses https://github.com/cypherstack/stack_wallet/issues/947
This commit is contained in:
julian 2024-07-22 13:07:22 -06:00 committed by julian-CStack
parent f3d1611249
commit 4f5354da0d

View file

@ -75,6 +75,14 @@ class _NewContactAddressEntryFormState
addressLabelFocusNode = FocusNode();
addressFocusNode = FocusNode();
coins = [...AppConfig.coins];
if (AppConfig.isSingleCoinApp) {
WidgetsBinding.instance.addPostFrameCallback((_) {
if (mounted) {
ref.read(addressEntryDataProvider(widget.id)).coin = coins.first;
}
});
}
super.initState();
}
@ -109,7 +117,7 @@ class _NewContactAddressEntryFormState
return Column(
children: [
if (isDesktop)
if (isDesktop && !AppConfig.isSingleCoinApp)
DropdownButtonHideUnderline(
child: DropdownButton2<CryptoCurrency>(
hint: Text(
@ -188,7 +196,7 @@ class _NewContactAddressEntryFormState
],
),
),
if (!isDesktop)
if (!isDesktop && !AppConfig.isSingleCoinApp)
TextField(
autocorrect: Util.isDesktop ? false : true,
enableSuggestions: Util.isDesktop ? false : true,
@ -280,9 +288,10 @@ class _NewContactAddressEntryFormState
),
),
),
const SizedBox(
height: 8,
),
if (!AppConfig.isSingleCoinApp)
const SizedBox(
height: 8,
),
ClipRRect(
borderRadius: BorderRadius.circular(
Constants.size.circularBorderRadius,