Kaynağa Gözat

Merge pull request #87 from shinriyo/feature/header_color_option

Header Color option for Datetime Picker
刘彦博 6 yıl önce
ebeveyn
işleme
e4da0ec77f

+ 3 - 1
lib/flutter_datetime_picker.dart

@@ -391,7 +391,9 @@ class _DatePickerState extends State<_DatePickerComponent> {
 
     return Container(
       height: theme.titleHeight,
-      decoration: BoxDecoration(color: theme.backgroundColor ?? Colors.white),
+      decoration: BoxDecoration(
+        color: theme.headerColor ?? theme.backgroundColor ?? Colors.white,
+      ),
       child: Row(
         mainAxisAlignment: MainAxisAlignment.spaceBetween,
         children: <Widget>[

+ 2 - 0
lib/src/datetime_picker_theme.dart

@@ -6,6 +6,7 @@ class DatePickerTheme extends Diagnosticable {
   final TextStyle doneStyle;
   final TextStyle itemStyle;
   final Color backgroundColor;
+  final Color headerColor;
 
   final double containerHeight;
   final double titleHeight;
@@ -16,6 +17,7 @@ class DatePickerTheme extends Diagnosticable {
     this.doneStyle = const TextStyle(color: Colors.blue, fontSize: 16),
     this.itemStyle = const TextStyle(color: Color(0xFF000046), fontSize: 18),
     this.backgroundColor = Colors.white,
+    this.headerColor,
     this.containerHeight = 210.0,
     this.titleHeight = 44.0,
     this.itemHeight = 36.0,