Commit 541a1bdd by Rizal Hermawan

modify theme and add title

parent 3e3ab8cf
......@@ -68,7 +68,7 @@ class DateTimePickerTheme with Diagnosticable {
final Widget confirm;
/// 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.
final bool showTitle;
......
......@@ -23,10 +23,27 @@ class DatePickerTitleWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
if (pickerTheme.title != null) {
return pickerTheme.title;
}
return Container(
return pickerTheme.title != null ? Container(
height: pickerTheme.titleHeight,
decoration: BoxDecoration(color: pickerTheme.backgroundColor),
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,
decoration: BoxDecoration(color: pickerTheme.backgroundColor),
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