Skip to content
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.

Removed ButtonBar dependencies from shrine/login and the cards demo #528

Merged
merged 4 commits into from
Jun 28, 2021
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
61 changes: 45 additions & 16 deletions lib/codeviewer/code_segments.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6594,30 +6594,55 @@ class CodeSegments {
TextSpan(
style: codeStyle.commentStyle, text: '// share, explore buttons'),
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
TextSpan(style: codeStyle.classStyle, text: 'ButtonBar'),
TextSpan(style: codeStyle.classStyle, text: 'Padding'),
TextSpan(style: codeStyle.punctuationStyle, text: '('),
TextSpan(style: codeStyle.baseStyle, text: '\u000a padding'),
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
TextSpan(style: codeStyle.baseStyle, text: ' '),
TextSpan(style: codeStyle.keywordStyle, text: 'const'),
TextSpan(style: codeStyle.baseStyle, text: ' '),
TextSpan(style: codeStyle.classStyle, text: 'EdgeInsets'),
TextSpan(style: codeStyle.punctuationStyle, text: '.'),
TextSpan(style: codeStyle.baseStyle, text: 'all'),
TextSpan(style: codeStyle.punctuationStyle, text: '('),
TextSpan(style: codeStyle.numberStyle, text: '8'),
TextSpan(style: codeStyle.punctuationStyle, text: '),'),
TextSpan(style: codeStyle.baseStyle, text: '\u000a child'),
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
TextSpan(style: codeStyle.baseStyle, text: ' '),
TextSpan(style: codeStyle.classStyle, text: 'OverflowBar'),
TextSpan(style: codeStyle.punctuationStyle, text: '('),
TextSpan(style: codeStyle.baseStyle, text: '\u000a alignment'),
TextSpan(
style: codeStyle.baseStyle, text: '\u000a alignment'),
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
TextSpan(style: codeStyle.baseStyle, text: ' '),
TextSpan(style: codeStyle.classStyle, text: 'MainAxisAlignment'),
TextSpan(style: codeStyle.punctuationStyle, text: '.'),
TextSpan(style: codeStyle.baseStyle, text: 'start'),
TextSpan(style: codeStyle.punctuationStyle, text: ','),
TextSpan(style: codeStyle.baseStyle, text: '\u000a children'),
TextSpan(style: codeStyle.baseStyle, text: '\u000a spacing'),
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
TextSpan(style: codeStyle.baseStyle, text: ' '),
TextSpan(style: codeStyle.numberStyle, text: '8'),
TextSpan(style: codeStyle.punctuationStyle, text: ','),
TextSpan(
style: codeStyle.baseStyle, text: '\u000a children'),
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
TextSpan(style: codeStyle.baseStyle, text: ' '),
TextSpan(style: codeStyle.punctuationStyle, text: '['),
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
TextSpan(style: codeStyle.classStyle, text: 'TextButton'),
TextSpan(style: codeStyle.punctuationStyle, text: '('),
TextSpan(
style: codeStyle.baseStyle, text: '\u000a onPressed'),
style: codeStyle.baseStyle,
text: '\u000a onPressed'),
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
TextSpan(style: codeStyle.baseStyle, text: ' '),
TextSpan(style: codeStyle.punctuationStyle, text: '()'),
TextSpan(style: codeStyle.baseStyle, text: ' '),
TextSpan(style: codeStyle.punctuationStyle, text: '{},'),
TextSpan(style: codeStyle.baseStyle, text: '\u000a child'),
TextSpan(
style: codeStyle.baseStyle, text: '\u000a child'),
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
TextSpan(style: codeStyle.baseStyle, text: ' '),
TextSpan(style: codeStyle.classStyle, text: 'Text'),
Expand All @@ -6632,7 +6657,7 @@ class CodeSegments {
TextSpan(style: codeStyle.punctuationStyle, text: ','),
TextSpan(
style: codeStyle.baseStyle,
text: '\u000a semanticsLabel'),
text: '\u000a semanticsLabel'),
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
TextSpan(style: codeStyle.baseStyle, text: ' '),
TextSpan(style: codeStyle.classStyle, text: 'GalleryLocalizations'),
Expand All @@ -6642,27 +6667,29 @@ class CodeSegments {
TextSpan(style: codeStyle.baseStyle, text: 'context'),
TextSpan(style: codeStyle.punctuationStyle, text: ')'),
TextSpan(
style: codeStyle.baseStyle, text: '\u000a '),
style: codeStyle.baseStyle, text: '\u000a '),
TextSpan(style: codeStyle.punctuationStyle, text: '.'),
TextSpan(style: codeStyle.baseStyle, text: 'cardsDemoShareSemantics'),
TextSpan(style: codeStyle.punctuationStyle, text: '('),
TextSpan(style: codeStyle.baseStyle, text: 'destination'),
TextSpan(style: codeStyle.punctuationStyle, text: '.'),
TextSpan(style: codeStyle.baseStyle, text: 'title'),
TextSpan(style: codeStyle.punctuationStyle, text: ')),'),
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
TextSpan(style: codeStyle.punctuationStyle, text: '),'),
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
TextSpan(style: codeStyle.classStyle, text: 'TextButton'),
TextSpan(style: codeStyle.punctuationStyle, text: '('),
TextSpan(
style: codeStyle.baseStyle, text: '\u000a onPressed'),
style: codeStyle.baseStyle,
text: '\u000a onPressed'),
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
TextSpan(style: codeStyle.baseStyle, text: ' '),
TextSpan(style: codeStyle.punctuationStyle, text: '()'),
TextSpan(style: codeStyle.baseStyle, text: ' '),
TextSpan(style: codeStyle.punctuationStyle, text: '{},'),
TextSpan(style: codeStyle.baseStyle, text: '\u000a child'),
TextSpan(
style: codeStyle.baseStyle, text: '\u000a child'),
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
TextSpan(style: codeStyle.baseStyle, text: ' '),
TextSpan(style: codeStyle.classStyle, text: 'Text'),
Expand All @@ -6677,7 +6704,7 @@ class CodeSegments {
TextSpan(style: codeStyle.punctuationStyle, text: ','),
TextSpan(
style: codeStyle.baseStyle,
text: '\u000a semanticsLabel'),
text: '\u000a semanticsLabel'),
TextSpan(style: codeStyle.punctuationStyle, text: ':'),
TextSpan(style: codeStyle.baseStyle, text: ' '),
TextSpan(style: codeStyle.classStyle, text: 'GalleryLocalizations'),
Expand All @@ -6687,18 +6714,20 @@ class CodeSegments {
TextSpan(style: codeStyle.baseStyle, text: 'context'),
TextSpan(style: codeStyle.punctuationStyle, text: ')'),
TextSpan(
style: codeStyle.baseStyle, text: '\u000a '),
style: codeStyle.baseStyle, text: '\u000a '),
TextSpan(style: codeStyle.punctuationStyle, text: '.'),
TextSpan(style: codeStyle.baseStyle, text: 'cardsDemoExploreSemantics'),
TextSpan(style: codeStyle.punctuationStyle, text: '('),
TextSpan(style: codeStyle.baseStyle, text: 'destination'),
TextSpan(style: codeStyle.punctuationStyle, text: '.'),
TextSpan(style: codeStyle.baseStyle, text: 'title'),
TextSpan(style: codeStyle.punctuationStyle, text: ')),'),
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
TextSpan(style: codeStyle.punctuationStyle, text: '),'),
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
TextSpan(style: codeStyle.punctuationStyle, text: '],'),
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
TextSpan(style: codeStyle.punctuationStyle, text: '),'),
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
TextSpan(style: codeStyle.punctuationStyle, text: '),'),
TextSpan(style: codeStyle.baseStyle, text: '\u000a '),
Expand Down
36 changes: 20 additions & 16 deletions lib/demos/material/cards_demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -338,22 +338,26 @@ class TravelDestinationContent extends StatelessWidget {
),
if (destination.cardType == CardType.standard)
// share, explore buttons
ButtonBar(
alignment: MainAxisAlignment.start,
children: [
TextButton(
onPressed: () {},
child: Text(GalleryLocalizations.of(context).demoMenuShare,
semanticsLabel: GalleryLocalizations.of(context)
.cardsDemoShareSemantics(destination.title)),
),
TextButton(
onPressed: () {},
child: Text(GalleryLocalizations.of(context).cardsDemoExplore,
semanticsLabel: GalleryLocalizations.of(context)
.cardsDemoExploreSemantics(destination.title)),
),
],
Padding(
padding: const EdgeInsets.all(8),
child: OverflowBar(
alignment: MainAxisAlignment.start,
spacing: 8,
children: [
TextButton(
onPressed: () {},
child: Text(GalleryLocalizations.of(context).demoMenuShare,
semanticsLabel: GalleryLocalizations.of(context)
.cardsDemoShareSemantics(destination.title)),
),
TextButton(
onPressed: () {},
child: Text(GalleryLocalizations.of(context).cardsDemoExplore,
semanticsLabel: GalleryLocalizations.of(context)
.cardsDemoExploreSemantics(destination.title)),
),
],
),
),
],
);
Expand Down
84 changes: 42 additions & 42 deletions lib/studies/shrine/login.dart
Original file line number Diff line number Diff line change
Expand Up @@ -168,54 +168,54 @@ class _CancelAndNextButtons extends StatelessWidget {
? const EdgeInsets.symmetric(horizontal: 24, vertical: 16)
: EdgeInsets.zero;

return Wrap(
children: [
ButtonBar(
buttonPadding: isDesktop ? EdgeInsets.zero : null,
children: [
TextButton(
style: TextButton.styleFrom(
shape: const BeveledRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(7)),
),
return Padding(
padding: isDesktop ? EdgeInsets.zero : const EdgeInsets.all(8),
child: OverflowBar(
spacing: isDesktop ? 0 : 8,
alignment: MainAxisAlignment.end,
children: [
TextButton(
style: TextButton.styleFrom(
shape: const BeveledRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(7)),
),
onPressed: () {
// The login screen is immediately displayed on top of
// the Shrine home screen using onGenerateRoute and so
// rootNavigator must be set to true in order to get out
// of Shrine completely.
Navigator.of(context, rootNavigator: true).pop();
},
child: Padding(
padding: buttonTextPadding,
child: Text(
GalleryLocalizations.of(context).shrineCancelButtonCaption,
style: TextStyle(color: colorScheme.onSurface),
),
),
onPressed: () {
// The login screen is immediately displayed on top of
// the Shrine home screen using onGenerateRoute and so
// rootNavigator must be set to true in order to get out
// of Shrine completely.
Navigator.of(context, rootNavigator: true).pop();
},
child: Padding(
padding: buttonTextPadding,
child: Text(
GalleryLocalizations.of(context).shrineCancelButtonCaption,
style: TextStyle(color: colorScheme.onSurface),
),
),
ElevatedButton(
style: ElevatedButton.styleFrom(
elevation: 8,
shape: const BeveledRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(7)),
),
),
ElevatedButton(
style: ElevatedButton.styleFrom(
elevation: 8,
shape: const BeveledRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(7)),
),
onPressed: () {
Navigator.of(context).restorablePushNamed(ShrineApp.homeRoute);
},
child: Padding(
padding: buttonTextPadding,
child: Text(
GalleryLocalizations.of(context).shrineNextButtonCaption,
style: TextStyle(
letterSpacing: letterSpacingOrNone(largeLetterSpacing)),
),
),
onPressed: () {
Navigator.of(context).restorablePushNamed(ShrineApp.homeRoute);
},
child: Padding(
padding: buttonTextPadding,
child: Text(
GalleryLocalizations.of(context).shrineNextButtonCaption,
style: TextStyle(
letterSpacing: letterSpacingOrNone(largeLetterSpacing)),
),
),
],
),
],
),
],
),
);
}
}
Expand Down