dylanwuzh/flutter-cupertino-date-picker

error with Flutter 2

monammedoz opened this issue · 8 comments

I got the below error after upgrading to flutter2

any help please

Xcode's output:

../../../../Flutter_dev/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_cupertino_date_picker-1.0.26+2/lib/src/date_picker_theme.dart:23:32: Error: Type 'DiagnosticableMixin' not found.
class DateTimePickerTheme with DiagnosticableMixin {
^^^^^^^^^^^^^^^^^^^
../../../../Flutter_dev/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_cupertino_date_picker-1.0.26+2/lib/src/date_picker_theme.dart:23:7: Error: The type 'DiagnosticableMixin' can't be mixed in.
class DateTimePickerTheme with DiagnosticableMixin {
^
../../../../Flutter_dev/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_cupertino_date_picker-1.0.26+2/lib/src/date_picker.dart:103:34: Error: No named parameter with the name 'shadowThemeOnly'.
theme: Theme.of(context, shadowThemeOnly: true),
^^^^^^^^^^^^^^^
../../../../Flutter_dev/flutter/packages/flutter/lib/src/material/theme.dart:107:20: Context: Found this candidate, but the arguments don't match.
static ThemeData of(BuildContext context) {

I have the same problem too !

I have the same problem too !

Same problem

same problem

Found a fix for now.

  • Open the DatePicker class (Control+click)
  • Comment this line
    // theme: Theme.of(context, shadowThemeOnly: true),

If you've use this plugin in one or two projects then modifying the local project files is just easier and faster. And yes, any plugin can be modified direct in code.