Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calendar hard to see in Darkmode on iOS #34

Closed
jclement opened this issue Jul 28, 2022 · 2 comments
Closed

Calendar hard to see in Darkmode on iOS #34

jclement opened this issue Jul 28, 2022 · 2 comments

Comments

@jclement
Copy link

I'm not sure if I'm doing something wrong here, but I've got an app using DateTimeFormField (3.0.1) on iOS. The app is dark mode-only and when you click into the date field it looks like it's adding a grey overlay over the entire screen (including the date picker) which makes the date picker very faint and difficult to read. I don't see this same thing on light mode.

toodark

Here is what I'm currently setting for my Theme:

import 'package:flutter/material.dart';

final ThemeData darkTheme = _buildDarkTheme();

ThemeData _buildDarkTheme() {
  final ThemeData base = ThemeData.dark();
  return base.copyWith(
    colorScheme: base.colorScheme.copyWith(
      primary: const Color.fromARGB(255, 40, 203, 162),
      onPrimary: const Color.fromARGB(255, 40, 101, 85),
      secondary: Colors.amber,
      error: Colors.red,
    ),
  );
}
class App extends StatelessWidget {
  const App({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Barreleye',
      theme: barreleyeDarkTheme,
      darkTheme: barreleyeDarkTheme,
      themeMode: ThemeMode.dark,
      home: const OperationList(),
    );
  }
}

And my invocation of the DateTimeFormField.

    fields.add(DateTimeFormField(
      decoration: const InputDecoration(
        //border: OutlineInputBorder(),
        suffixIcon: Icon(Icons.event_note),
        labelText: 'Ticket Date',
      ),
      initialValue: _date,
      enabled: _enableEditing,
      mode: DateTimeFieldPickerMode.dateAndTime,
      autovalidateMode: AutovalidateMode.always,
      validator: (DateTime? value) {
        if (value != null &&
            (widget.op.start.isAfter(value) || widget.op.end.isBefore(value))) {
          return "Ticket falls outside of operation range";
        }
        return null;
      },
      onDateSelected: (DateTime value) {
        _date = value;
      },
    ));
@GaspardMerten
Copy link
Owner

Could you try changing the value of:

´CupertinoTheme.textTheme.dateTimePickerTextStyle´

Does it help?

@jclement
Copy link
Author

That worked. Thank you so much! TIL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants