> For the complete documentation index, see [llms.txt](https://triyono.gitbook.io/fluttercheatsheet/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://triyono.gitbook.io/fluttercheatsheet/my-note/custom-theme-datepicker-flutter.md).

# Custom Theme DatePicker Flutter

```dart
showDatePicker(
  builder: (context, child) {
    return Theme(
      data: Theme.of(context).copyWith(
        colorScheme: ColorScheme.light(
          primary: Colors.yellow, // header background color
          onPrimary: Colors.black, // header text color
          onSurface: Colors.green, // body text color
        ),
        textButtonTheme: TextButtonThemeData(
          style: TextButton.styleFrom(
            primary: Colors.red, // button text color
          ),
        ),
      ),
      child: child!,
    );
  },
);
```

{% embed url="<https://stackoverflow.com/questions/50321182/how-to-customize-a-date-picker>" %}
