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

View file

@ -247,9 +247,7 @@ class SendPage extends BasePage {
),
bottomSectionPadding:
EdgeInsets.only(left: 24, right: 24, bottom: 24),
bottomSection: ConstrainedBox(
constraints: BoxConstraints(maxWidth: ResponsiveLayoutUtil.kDesktopMaxWidthConstraint),
child: Column(
bottomSection: Column(
children: [
if (sendViewModel.hasCurrecyChanger)
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:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -24,7 +25,9 @@ class PrimaryButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
final content = SizedBox(
final content = ConstrainedBox(
constraints: BoxConstraints(maxWidth: ResponsiveLayoutUtil.kDesktopMaxWidthConstraint),
child: SizedBox(
width: double.infinity,
height: 52.0,
child: TextButton(
@ -45,7 +48,8 @@ class PrimaryButton extends StatelessWidget {
color: isDisabled
? textColor.withOpacity(0.5)
: textColor)),
));
)),
);
return isDottedBorder
? DottedBorder(
@ -77,7 +81,9 @@ class LoadingPrimaryButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
return SizedBox(
return ConstrainedBox(
constraints: BoxConstraints(maxWidth: ResponsiveLayoutUtil.kDesktopMaxWidthConstraint),
child: SizedBox(
width: double.infinity,
height: 52.0,
child: TextButton(
@ -99,7 +105,8 @@ class LoadingPrimaryButton extends StatelessWidget {
? textColor.withOpacity(0.5)
: textColor
)),
));
)),
);
}
}
@ -130,7 +137,9 @@ class PrimaryIconButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
return SizedBox(
return ConstrainedBox(
constraints: BoxConstraints(maxWidth: ResponsiveLayoutUtil.kDesktopMaxWidthConstraint),
child: SizedBox(
width: double.infinity,
height: 52.0,
child: TextButton(
@ -168,7 +177,8 @@ class PrimaryIconButton extends StatelessWidget {
)
],
),
));
)),
);
}
}
@ -190,7 +200,9 @@ class PrimaryImageButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
return SizedBox(
return ConstrainedBox(
constraints: BoxConstraints(maxWidth: ResponsiveLayoutUtil.kDesktopMaxWidthConstraint),
child: SizedBox(
width: double.infinity,
height: 52.0,
child: TextButton(
@ -218,6 +230,7 @@ class PrimaryImageButton extends StatelessWidget {
],
),
)
));
)),
);
}
}