Remove duplicated constrains

This commit is contained in:
OmarHatem 2023-02-15 23:50:15 +02:00
parent 8de9c80fe1
commit 5296a2118a
2 changed files with 30 additions and 37 deletions

View file

@ -91,8 +91,7 @@ class _WalletNameFormState extends State<WalletNameForm> {
contentPadding: EdgeInsets.only(left: 24, right: 24, bottom: 24), contentPadding: EdgeInsets.only(left: 24, right: 24, bottom: 24),
content: Center( content: Center(
child: ConstrainedBox( child: ConstrainedBox(
constraints: constraints: BoxConstraints(maxWidth: ResponsiveLayoutUtil.kDesktopMaxWidthConstraint),
BoxConstraints(maxWidth: ResponsiveLayoutUtil.kDesktopMaxWidthConstraint),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
@ -197,32 +196,29 @@ class _WalletNameFormState extends State<WalletNameForm> {
), ),
), ),
bottomSectionPadding: EdgeInsets.all(24), bottomSectionPadding: EdgeInsets.all(24),
bottomSection: ConstrainedBox( bottomSection: Column(
constraints: BoxConstraints(maxWidth: ResponsiveLayoutUtil.kDesktopMaxWidthConstraint), children: [
child: Column( Observer(
children: [ builder: (context) {
Observer( return LoadingPrimaryButton(
builder: (context) { onPressed: _confirmForm,
return LoadingPrimaryButton( text: S.of(context).seed_language_next,
onPressed: _confirmForm, color: Colors.green,
text: S.of(context).seed_language_next, textColor: Colors.white,
color: Colors.green, isLoading: _walletNewVM.state is IsExecutingState,
textColor: Colors.white, isDisabled: _walletNewVM.name.isEmpty,
isLoading: _walletNewVM.state is IsExecutingState, );
isDisabled: _walletNewVM.name.isEmpty, },
); ),
}, const SizedBox(height: 25),
), GestureDetector(
const SizedBox(height: 25), onTap: () {
GestureDetector( Navigator.of(context)
onTap: () { .pushNamed(Routes.advancedPrivacySettings, arguments: _walletNewVM.type);
Navigator.of(context) },
.pushNamed(Routes.advancedPrivacySettings, arguments: _walletNewVM.type); child: Text(S.of(context).advanced_privacy_settings),
}, ),
child: Text(S.of(context).advanced_privacy_settings), ],
),
],
),
)), )),
); );
} }

View file

@ -96,15 +96,12 @@ class WalletTypeFormState extends State<WalletTypeForm> {
), ),
), ),
bottomSectionPadding: EdgeInsets.only(left: 24, right: 24, bottom: 24), bottomSectionPadding: EdgeInsets.only(left: 24, right: 24, bottom: 24),
bottomSection: ConstrainedBox( bottomSection: PrimaryButton(
constraints: BoxConstraints(maxWidth: ResponsiveLayoutUtil.kDesktopMaxWidthConstraint), onPressed: () => onTypeSelected(),
child: PrimaryButton( text: S.of(context).seed_language_next,
onPressed: () => onTypeSelected(), color: Theme.of(context).accentTextTheme.bodyText1!.color!,
text: S.of(context).seed_language_next, textColor: Colors.white,
color: Theme.of(context).accentTextTheme.bodyText1!.color!, isDisabled: selected == null,
textColor: Colors.white,
isDisabled: selected == null,
),
), ),
); );
} }