change text color of CupertinoTimerPicker
Asked Answered
G

0

0

I tried to change the text color of CupertinoDatePicker following this answer and it was successful but when i wanted to change the color of CupertinoTimerPicker it did not change it i want the color of text to be white and the style to be same as the one below

enter image description here

showDialog(
  context: context,

  builder: (context) {
    return AlertDialog(
        backgroundColor: const Color(0xff2e2e2e),
        title: Column(
          children: [
            Text(
              'Set Duration',
              style: TextStyle(
                  color: Colors.white, fontSize: 16),
            ),
            Divider(
              height: 6,
              color: Colors.white,
            ),

          ],
        ),
        content: CupertinoTheme(
          data: CupertinoThemeData(
            brightness: Brightness.light,
            textTheme: CupertinoTextThemeData(
              dateTimePickerTextStyle: TextStyle(color: Colors.red),
            ),
          ),
          child: CupertinoTimerPicker(
            mode: CupertinoTimerPickerMode.hms,
            minuteInterval: 1,
            secondInterval: 1,
            initialTimerDuration: Duration(hours:0, minutes: 0, seconds: 0),
            onTimerDurationChanged: (Duration changedTimer) {
              setState(() {
                initialTimer = changedTimer;
              });
            },
          ),
        ),
    );
  },
);
Grecoroman answered 3/6, 2022 at 23:23 Comment(5)
I think you can follow this while textStyle applied to all text. if you want to change all text color it can be done using CupertinoThemeInclose
hey thanks but i didnt find the solution with that did you see my code?Grecoroman
You can trying creating custom widget for this, using ListViewInclose
@YeasinSheikh its a scroll wheel picker widget is it possible?Grecoroman
Yes you can use ListWheelScrollViewInclose

© 2022 - 2024 — McMap. All rights reserved.