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

Error: DatePickerTheme' isn't a function. #316

Open
AKovynev opened this issue Feb 7, 2023 · 5 comments
Open

Error: DatePickerTheme' isn't a function. #316

AKovynev opened this issue Feb 7, 2023 · 5 comments

Comments

@AKovynev
Copy link

AKovynev commented Feb 7, 2023

Today I am getting an error: 'DatePickerTheme' isn't a function.
Try correcting the name to match an existing function, or define a method or function named 'DatePickerTheme'.
image

@sarp86
Copy link

sarp86 commented Feb 26, 2023

Any solutions? We should wait for fix?

@SerdarYildiz06
Copy link

It may seem irrelevant, but when I referenced the package from github, not pubdev, this problem was solved.

@ajayprakashshukla
Copy link

It may seem irrelevant, but when I referenced the package from github, not pubdev, this problem was solved.

This didn't work out in my case, I still get the error.
I'm referencing the package as such :

  flutter_datetime_picker:
    git:
      url: https://github.com/Realank/flutter_datetime_picker.git
      ref: master

@Anyitechs
Copy link

It may seem irrelevant, but when I referenced the package from github, not pubdev, this problem was solved.

This didn't work out in my case, I still get the error. I'm referencing the package as such :

  flutter_datetime_picker:
    git:
      url: https://github.com/Realank/flutter_datetime_picker.git
      ref: master

I fixed this earlier internally. All I did was to rename the DatePickerTheme being imported from 'package:flutter_datetime_picker/src/datetime_picker_theme.dart' as it's conflicting with Flutter's native DatePickerTheme function. Or you can refer to the fix on this PR that fixes the issue using aliases.

@rs-huypq
Copy link

rs-huypq commented Dec 2, 2023

You can try this
Change to this and use dtpicker or any name you want

import 'package:flutter_datetime_picker/flutter_datetime_picker.dart' as dtpicker;

After

dtpicker.DatePicker(...)
or
dtpicker.DatePickerTheme(...)

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

6 participants