Commit 541a1bdd by Rizal Hermawan

modify theme and add title

parent 3e3ab8cf
...@@ -68,7 +68,7 @@ class DateTimePickerTheme with Diagnosticable { ...@@ -68,7 +68,7 @@ class DateTimePickerTheme with Diagnosticable {
final Widget confirm; final Widget confirm;
/// Custom title [Widget]. If specify a title widget, the cancel and confirm widgets will not display. /// Custom title [Widget]. If specify a title widget, the cancel and confirm widgets will not display.
final Widget title; final String title;
/// Whether display title widget or not. If set false, the default cancel and confirm widgets will not display, but the custom title widget will display if had specified one custom title widget. /// Whether display title widget or not. If set false, the default cancel and confirm widgets will not display, but the custom title widget will display if had specified one custom title widget.
final bool showTitle; final bool showTitle;
......
...@@ -23,10 +23,27 @@ class DatePickerTitleWidget extends StatelessWidget { ...@@ -23,10 +23,27 @@ class DatePickerTitleWidget extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
if (pickerTheme.title != null) { return pickerTheme.title != null ? Container(
return pickerTheme.title; height: pickerTheme.titleHeight,
} decoration: BoxDecoration(color: pickerTheme.backgroundColor),
return Container( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
_renderCancelWidget(context),
Container(
height: pickerTheme.titleHeight,
child: FlatButton(
shape: RoundedRectangleBorder(borderRadius: BorderRadius.zero),
child: Text(
pickerTheme.title,
),
onPressed: () {}
),
),
_renderConfirmWidget(context),
],
),
) : Container(
height: pickerTheme.titleHeight, height: pickerTheme.titleHeight,
decoration: BoxDecoration(color: pickerTheme.backgroundColor), decoration: BoxDecoration(color: pickerTheme.backgroundColor),
child: Row( child: Row(
......
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