Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Vertical axis for buttons in the permission dialog #2906

Merged
merged 1 commit into from
Sep 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,8 @@ class SmoothActionButtonsBar extends StatelessWidget {
children: actions,
);
} else {
return IntrinsicWidth(
return SizedBox(
width: double.infinity,
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: actions,
Expand Down Expand Up @@ -369,8 +370,9 @@ class _SmoothActionElevatedButton extends StatelessWidget {
return SmoothSimpleButton(
onPressed: buttonData.onPressed,
minWidth: buttonData.minWidth ?? 20.0,
// if fitted box not used then even the one word text overflows into next line,
// Ensures FittedBox not used then even the one word text overflows into next line,
child: FittedBox(
fit: BoxFit.scaleDown,
child: Text(
buttonData.text.toUpperCase(),
textAlign: TextAlign.center,
Expand Down Expand Up @@ -414,13 +416,17 @@ class _SmoothActionFlatButton extends StatelessWidget {
textStyle: themeData.textTheme.bodyText2!.copyWith(
color: themeData.colorScheme.onPrimary,
),
padding: const EdgeInsets.symmetric(
horizontal: SMALL_SPACE,
),
),
child: SizedBox(
height: buttonData.lines != null
? VERY_LARGE_SPACE * buttonData.lines!
: null,
width: buttonData.minWidth,
child: FittedBox(
fit: BoxFit.scaleDown,
child: Text(
buttonData.text.toUpperCase(),
style: TextStyle(
Expand Down
1 change: 1 addition & 0 deletions packages/smooth_app/lib/pages/scan/scan_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ class _ScanPageTopWidget extends StatelessWidget {
onPressed: () => Navigator.of(context).pop(true),
lines: 2,
),
actionsAxis: Axis.vertical,
);
});
});
Expand Down