Skip to content

Commit

Permalink
fix: Add option to use non-elevated buttons for navigation (#1070)
Browse files Browse the repository at this point in the history
Adds an option to use elevated or outlined buttons for "next"
navigation. Non-action buttons should be outlined instead of elevated.


![image](https://github.com/user-attachments/assets/00828a08-5968-49ff-afaf-6e5ef41b8f04)
*Note "Next" is outlined instead of green*
  • Loading branch information
ashuntu authored Jan 22, 2025
2 parents 67cf92c + 10bd82d commit e8dc58d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class _LandscapeSkipPageState extends State<LandscapeSkipPage> {
navigationRow: NavigationRow(
onBack: wizard.back,
onNext: () => wizard.next(arguments: groupValue),
nextIsAction: false,
),
);
}
Expand Down
15 changes: 11 additions & 4 deletions gui/packages/ubuntupro/lib/pages/widgets/navigation_row.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class NavigationRow extends StatelessWidget {
this.nextText,
this.showBack = true,
this.showNext = true,
this.nextIsAction = true,
super.key,
});

Expand All @@ -18,6 +19,7 @@ class NavigationRow extends StatelessWidget {
final void Function()? onNext;
final String? nextText;
final bool showNext;
final bool nextIsAction;

@override
Widget build(BuildContext context) {
Expand All @@ -32,10 +34,15 @@ class NavigationRow extends StatelessWidget {
),
if (showNext) ...[
const Spacer(),
ElevatedButton(
onPressed: onNext,
child: Text(nextText ?? lang.buttonNext),
),
nextIsAction
? ElevatedButton(
onPressed: onNext,
child: Text(nextText ?? lang.buttonNext),
)
: OutlinedButton(
onPressed: onNext,
child: Text(nextText ?? lang.buttonNext),
),
],
],
);
Expand Down

0 comments on commit e8dc58d

Please sign in to comment.