Constrain primary Buttons width

This commit is contained in:
OmarHatem 2023-02-14 18:05:44 +02:00
parent fb5efc0429
commit 02fe3c008f
3 changed files with 249 additions and 242 deletions

View file

@ -163,9 +163,7 @@ class ExchangePage extends BasePage {
), ),
bottomSectionPadding: bottomSectionPadding:
EdgeInsets.only(left: 24, right: 24, bottom: 24), EdgeInsets.only(left: 24, right: 24, bottom: 24),
bottomSection: ConstrainedBox( bottomSection: Column(children: <Widget>[
constraints: BoxConstraints(maxWidth: ResponsiveLayoutUtil.kDesktopMaxWidthConstraint),
child: Column(children: <Widget>[
Padding( Padding(
padding: EdgeInsets.only(bottom: 15), padding: EdgeInsets.only(bottom: 15),
child: Observer(builder: (_) { child: Observer(builder: (_) {
@ -222,7 +220,6 @@ class ExchangePage extends BasePage {
isDisabled: exchangeViewModel.selectedProviders.isEmpty, isDisabled: exchangeViewModel.selectedProviders.isEmpty,
isLoading: exchangeViewModel.tradeState is TradeIsCreating)), isLoading: exchangeViewModel.tradeState is TradeIsCreating)),
]), ]),
),
)), )),
)); ));
} }

View file

@ -247,9 +247,7 @@ class SendPage extends BasePage {
), ),
bottomSectionPadding: bottomSectionPadding:
EdgeInsets.only(left: 24, right: 24, bottom: 24), EdgeInsets.only(left: 24, right: 24, bottom: 24),
bottomSection: ConstrainedBox( bottomSection: Column(
constraints: BoxConstraints(maxWidth: ResponsiveLayoutUtil.kDesktopMaxWidthConstraint),
child: Column(
children: [ children: [
if (sendViewModel.hasCurrecyChanger) if (sendViewModel.hasCurrecyChanger)
Observer(builder: (_) => Observer(builder: (_) =>
@ -323,7 +321,6 @@ class SendPage extends BasePage {
}, },
) )
], ],
),
)), )),
); );
} }

View file

@ -1,3 +1,4 @@
import 'package:cake_wallet/utils/responsive_layout_util.dart';
import 'package:dotted_border/dotted_border.dart'; import 'package:dotted_border/dotted_border.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -24,7 +25,9 @@ class PrimaryButton extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final content = SizedBox( final content = ConstrainedBox(
constraints: BoxConstraints(maxWidth: ResponsiveLayoutUtil.kDesktopMaxWidthConstraint),
child: SizedBox(
width: double.infinity, width: double.infinity,
height: 52.0, height: 52.0,
child: TextButton( child: TextButton(
@ -45,7 +48,8 @@ class PrimaryButton extends StatelessWidget {
color: isDisabled color: isDisabled
? textColor.withOpacity(0.5) ? textColor.withOpacity(0.5)
: textColor)), : textColor)),
)); )),
);
return isDottedBorder return isDottedBorder
? DottedBorder( ? DottedBorder(
@ -77,7 +81,9 @@ class LoadingPrimaryButton extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SizedBox( return ConstrainedBox(
constraints: BoxConstraints(maxWidth: ResponsiveLayoutUtil.kDesktopMaxWidthConstraint),
child: SizedBox(
width: double.infinity, width: double.infinity,
height: 52.0, height: 52.0,
child: TextButton( child: TextButton(
@ -99,7 +105,8 @@ class LoadingPrimaryButton extends StatelessWidget {
? textColor.withOpacity(0.5) ? textColor.withOpacity(0.5)
: textColor : textColor
)), )),
)); )),
);
} }
} }
@ -130,7 +137,9 @@ class PrimaryIconButton extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SizedBox( return ConstrainedBox(
constraints: BoxConstraints(maxWidth: ResponsiveLayoutUtil.kDesktopMaxWidthConstraint),
child: SizedBox(
width: double.infinity, width: double.infinity,
height: 52.0, height: 52.0,
child: TextButton( child: TextButton(
@ -168,7 +177,8 @@ class PrimaryIconButton extends StatelessWidget {
) )
], ],
), ),
)); )),
);
} }
} }
@ -190,7 +200,9 @@ class PrimaryImageButton extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SizedBox( return ConstrainedBox(
constraints: BoxConstraints(maxWidth: ResponsiveLayoutUtil.kDesktopMaxWidthConstraint),
child: SizedBox(
width: double.infinity, width: double.infinity,
height: 52.0, height: 52.0,
child: TextButton( child: TextButton(
@ -218,6 +230,7 @@ class PrimaryImageButton extends StatelessWidget {
], ],
), ),
) )
)); )),
);
} }
} }