Update widget contraints

This commit is contained in:
Godwin Asuquo 2023-02-10 20:07:53 +02:00
parent 150d43b2da
commit 32d2bf2c85
2 changed files with 168 additions and 152 deletions

View file

@ -50,7 +50,7 @@ class _WalletNameFormState extends State<WalletNameForm> {
_languageSelectorKey = GlobalKey<SeedLanguageSelectorState>(), _languageSelectorKey = GlobalKey<SeedLanguageSelectorState>(),
_controller = TextEditingController(); _controller = TextEditingController();
// static const aspectRatioImage = 1.22; static const aspectRatioImage = 1.22;
final GlobalKey<FormState> _formKey; final GlobalKey<FormState> _formKey;
final GlobalKey<SeedLanguageSelectorState> _languageSelectorKey; final GlobalKey<SeedLanguageSelectorState> _languageSelectorKey;
@ -84,15 +84,18 @@ class _WalletNameFormState extends State<WalletNameForm> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Padding(
padding: EdgeInsets.only(top: 24), padding: EdgeInsets.only(top: 24),
child: Center(
child: ConstrainedBox(
constraints: BoxConstraints(maxWidth: 600),
child: ScrollableWithBottomSection( child: ScrollableWithBottomSection(
contentPadding: EdgeInsets.only(left: 24, right: 24, bottom: 24), contentPadding: EdgeInsets.only(left: 24, right: 24, bottom: 24),
content: Column(crossAxisAlignment: CrossAxisAlignment.center, children: [ content: Column(crossAxisAlignment: CrossAxisAlignment.center, children: [
Padding( Padding(
padding: EdgeInsets.only(left: 12, right: 12), padding: EdgeInsets.only(left: 12, right: 12),
child: SizedBox( child: AspectRatio(
height: MediaQuery.of(context).size.height * 0.4, aspectRatio: aspectRatioImage,
child: FittedBox(child: widget.walletImage, fit: BoxFit.fill)), child: FittedBox(child: widget.walletImage, fit: BoxFit.fill)),
), ),
Padding( Padding(
@ -118,12 +121,17 @@ class _WalletNameFormState extends State<WalletNameForm> {
hintText: S.of(context).wallet_name, hintText: S.of(context).wallet_name,
focusedBorder: UnderlineInputBorder( focusedBorder: UnderlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(
color: color: Theme.of(context)
Theme.of(context).accentTextTheme!.headline2!.decorationColor!, .accentTextTheme!
.headline2!
.decorationColor!,
width: 1.0)), width: 1.0)),
enabledBorder: UnderlineInputBorder( enabledBorder: UnderlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(
color: Theme.of(context).accentTextTheme!.headline2!.decorationColor!, color: Theme.of(context)
.accentTextTheme!
.headline2!
.decorationColor!,
width: 1.0), width: 1.0),
), ),
suffixIcon: IconButton( suffixIcon: IconButton(
@ -148,8 +156,10 @@ class _WalletNameFormState extends State<WalletNameForm> {
height: 34, height: 34,
child: Image.asset( child: Image.asset(
'assets/images/refresh_icon.png', 'assets/images/refresh_icon.png',
color: color: Theme.of(context)
Theme.of(context).primaryTextTheme!.headline4!.decorationColor!, .primaryTextTheme!
.headline4!
.decorationColor!,
), ),
), ),
), ),
@ -204,6 +214,8 @@ class _WalletNameFormState extends State<WalletNameForm> {
), ),
], ],
)), )),
),
),
); );
} }

View file

@ -57,17 +57,19 @@ class WalletTypeFormState extends State<WalletTypeForm> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return ScrollableWithBottomSection( return Center(
child: ConstrainedBox(
constraints: BoxConstraints(maxWidth: 600),
child: ScrollableWithBottomSection(
contentPadding: EdgeInsets.only(left: 24, right: 24, bottom: 24), contentPadding: EdgeInsets.only(left: 24, right: 24, bottom: 24),
content: Column( content: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Padding( Padding(
padding: EdgeInsets.only(left: 12, right: 12), padding: EdgeInsets.only(left: 12, right: 12),
child: SizedBox( child: AspectRatio(
height: MediaQuery.of(context).size.height * 0.4, aspectRatio: aspectRatioImage,
child: FittedBox(child: widget.walletImage, fit: BoxFit.fitWidth), child: FittedBox(child: widget.walletImage, fit: BoxFit.fill)),
),
), ),
Padding( Padding(
padding: EdgeInsets.only(top: 48), padding: EdgeInsets.only(top: 48),
@ -98,6 +100,8 @@ class WalletTypeFormState extends State<WalletTypeForm> {
textColor: Colors.white, textColor: Colors.white,
isDisabled: selected == null, isDisabled: selected == null,
), ),
),
),
); );
} }