Repository navigation
Updated time pickers to use the new TextButton in place of FlatButton. - #61492
Conversation
|
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat. Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
| @@ -1831,11 +1831,11 @@ class _TimePickerDialogState extends State<_TimePickerDialog> { | |||
| child: ButtonBar( | |||
There was a problem hiding this comment.
Could we eliminate the ButtonBar here?
There was a problem hiding this comment.
We can, but then we would lose some of the padding around the buttons that the ButtonBar provides. Might trip up some golden tests.
There was a problem hiding this comment.
I think you can get the same effect with
Container(
alignment: Alignment.center,
padding: EdgeInsets.symmetric(horizontal: 8),
constraints: const BoxConstraints(minHeight: 52.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
TextButton(
onPressed: _handleCancel,
child: Text(widget.cancelText ?? localizations.cancelButtonLabel),
),
const SizedBox(width: 8),
TextButton(
onPressed: _handleOk,
child: Text(widget.confirmText ?? localizations.okButtonLabel),
),
],
),
)There was a problem hiding this comment.
There's special behavior in ButtonBar that puts the buttons in a column if they don't fit in a row (good for i18n cases or custom button text), so I'd say we keep the button bar until we have a good replacement for that
There was a problem hiding this comment.
Is that really an issue with the time picker? Can the picker become narrow enough to require making a column out of the OK/Cancel buttons while otherwise remaining usable?
There was a problem hiding this comment.
I think it may be possible in other locales (german perhaps?)
There was a problem hiding this comment.
OK, with me to leave this as-is for the moment. I'm going to write a row-unless-theres-no-room-then-a-column that we can replace ButtonBar with. Until then, this is good.
| @@ -1831,11 +1831,11 @@ class _TimePickerDialogState extends State<_TimePickerDialog> { | |||
| child: ButtonBar( | |||
There was a problem hiding this comment.
There's special behavior in ButtonBar that puts the buttons in a column if they don't fit in a row (good for i18n cases or custom button text), so I'd say we keep the button bar until we have a good replacement for that
Updated the Material Time Picker to use
TextButtoninstead ofFlatButtonas part of the transition to the new button universe (#59702).