Closed ghost closed 1 year ago
Hi @stefan-weinand, currently the theme of the OmniDateTimePicker follows the theme of your app, which is defined in your MaterialApp, the one in the screenshots can be reproduced with this code:
class MyApp extends StatelessWidget {
const MyApp({super.key});
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Flutter Demo',
theme: ThemeData(
useMaterial3: true,
colorSchemeSeed: Colors.blue,
brightness: Brightness.dark,
),
home: const Home());
}
}
If you wish to have a finer control of the theme that only affects the OmniDateTimePicker widget, I'll create a property that accepts a ThemeData. Is that what you need?
Yes, a showOmniDateTimePicker() method with a builder or a themeData property would be great! :)
@stefan-weinand I've publish v1.0.7 with the proposed feature, you can try it out with something like this:
await showOmniDateTimePicker(
context: context,
isForce2Digits: true,
isShowSeconds: true,
is24HourMode: true,
theme: ThemeData(
useMaterial3: true,
colorSchemeSeed: Colors.yellow,
brightness: Brightness.dark,
),
);
By passing in a ThemeData into a theme property.
Oh my god, how awesome is that! Thank you very much!!!! 👍 🥇 💯
@stefan-weinand No problem, much appreciated if you would kindly star this repo. I'll close this issue for now.
Is there a way to customize the theme of the OmniDateTimePicker? Especially in dark mode the picker does not look as expected, and at least not as nice as on the description screenshots. I tried to wrap the corresponding TextField() with onTap handler into a Theme() widget and I also tried different solutions from https://stackoverflow.com/questions/50321182/how-to-customize-a-date-picker, but that didn't help.