Unverified Commit eb69a20c authored by Yegor's avatar Yegor Committed by GitHub

fix date/time picker borders (#16240)

parent 3a5ed64f
...@@ -896,6 +896,7 @@ class _DatePickerDialogState extends State<_DatePickerDialog> { ...@@ -896,6 +896,7 @@ class _DatePickerDialogState extends State<_DatePickerDialog> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final ThemeData theme = Theme.of(context);
final Widget picker = new Flexible( final Widget picker = new Flexible(
child: new SizedBox( child: new SizedBox(
height: _kMaxDayPickerHeight, height: _kMaxDayPickerHeight,
...@@ -916,7 +917,7 @@ class _DatePickerDialogState extends State<_DatePickerDialog> { ...@@ -916,7 +917,7 @@ class _DatePickerDialogState extends State<_DatePickerDialog> {
], ],
), ),
); );
return new Dialog( final Dialog dialog = new Dialog(
child: new OrientationBuilder( child: new OrientationBuilder(
builder: (BuildContext context, Orientation orientation) { builder: (BuildContext context, Orientation orientation) {
assert(orientation != null); assert(orientation != null);
...@@ -933,7 +934,20 @@ class _DatePickerDialogState extends State<_DatePickerDialog> { ...@@ -933,7 +934,20 @@ class _DatePickerDialogState extends State<_DatePickerDialog> {
child: new Column( child: new Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[header, picker, actions], children: <Widget>[
header,
new Container(
color: theme.dialogBackgroundColor,
child: new Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
picker,
actions,
],
),
),
],
), ),
); );
case Orientation.landscape: case Orientation.landscape:
...@@ -945,8 +959,9 @@ class _DatePickerDialogState extends State<_DatePickerDialog> { ...@@ -945,8 +959,9 @@ class _DatePickerDialogState extends State<_DatePickerDialog> {
children: <Widget>[ children: <Widget>[
header, header,
new Flexible( new Flexible(
child: new SizedBox( child: new Container(
width: _kMonthPickerLandscapeWidth, width: _kMonthPickerLandscapeWidth,
color: theme.dialogBackgroundColor,
child: new Column( child: new Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
...@@ -962,6 +977,13 @@ class _DatePickerDialogState extends State<_DatePickerDialog> { ...@@ -962,6 +977,13 @@ class _DatePickerDialogState extends State<_DatePickerDialog> {
} }
) )
); );
return new Theme(
data: theme.copyWith(
dialogBackgroundColor: Colors.transparent,
),
child: dialog,
);
} }
} }
......
...@@ -1523,6 +1523,7 @@ class _TimePickerDialogState extends State<_TimePickerDialog> { ...@@ -1523,6 +1523,7 @@ class _TimePickerDialogState extends State<_TimePickerDialog> {
final MediaQueryData media = MediaQuery.of(context); final MediaQueryData media = MediaQuery.of(context);
final TimeOfDayFormat timeOfDayFormat = localizations.timeOfDayFormat(alwaysUse24HourFormat: media.alwaysUse24HourFormat); final TimeOfDayFormat timeOfDayFormat = localizations.timeOfDayFormat(alwaysUse24HourFormat: media.alwaysUse24HourFormat);
final bool use24HourDials = hourFormat(of: timeOfDayFormat) != HourFormat.h; final bool use24HourDials = hourFormat(of: timeOfDayFormat) != HourFormat.h;
final ThemeData theme = Theme.of(context);
final Widget picker = new Padding( final Widget picker = new Padding(
padding: const EdgeInsets.all(16.0), padding: const EdgeInsets.all(16.0),
...@@ -1552,7 +1553,7 @@ class _TimePickerDialogState extends State<_TimePickerDialog> { ...@@ -1552,7 +1553,7 @@ class _TimePickerDialogState extends State<_TimePickerDialog> {
) )
); );
return new Dialog( final Dialog dialog = new Dialog(
child: new OrientationBuilder( child: new OrientationBuilder(
builder: (BuildContext context, Orientation orientation) { builder: (BuildContext context, Orientation orientation) {
final Widget header = new _TimePickerHeader( final Widget header = new _TimePickerHeader(
...@@ -1564,6 +1565,17 @@ class _TimePickerDialogState extends State<_TimePickerDialog> { ...@@ -1564,6 +1565,17 @@ class _TimePickerDialogState extends State<_TimePickerDialog> {
use24HourDials: use24HourDials, use24HourDials: use24HourDials,
); );
final Widget pickerAndActions = new Container(
color: theme.dialogBackgroundColor,
child: new Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
new Expanded(child: picker), // picker grows and shrinks with the available space
actions,
],
),
);
assert(orientation != null); assert(orientation != null);
switch (orientation) { switch (orientation) {
case Orientation.portrait: case Orientation.portrait:
...@@ -1575,8 +1587,9 @@ class _TimePickerDialogState extends State<_TimePickerDialog> { ...@@ -1575,8 +1587,9 @@ class _TimePickerDialogState extends State<_TimePickerDialog> {
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[ children: <Widget>[
header, header,
new Expanded(child: picker), new Expanded(
actions, child: pickerAndActions,
),
] ]
) )
); );
...@@ -1590,12 +1603,7 @@ class _TimePickerDialogState extends State<_TimePickerDialog> { ...@@ -1590,12 +1603,7 @@ class _TimePickerDialogState extends State<_TimePickerDialog> {
children: <Widget>[ children: <Widget>[
header, header,
new Flexible( new Flexible(
child: new Column( child: pickerAndActions,
children: <Widget>[
new Expanded(child: picker),
actions,
]
)
), ),
] ]
) )
...@@ -1605,6 +1613,13 @@ class _TimePickerDialogState extends State<_TimePickerDialog> { ...@@ -1605,6 +1613,13 @@ class _TimePickerDialogState extends State<_TimePickerDialog> {
} }
) )
); );
return new Theme(
data: theme.copyWith(
dialogBackgroundColor: Colors.transparent,
),
child: dialog,
);
} }
@override @override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment