Error: ‘DatePickerTheme’ is imported from both ‘package:flutter/src/material/date_picker_theme.dart’ and
‘package:flutter_datetime_picker/src/datetime_picker_theme.dart’.
I just want to solve this error in Flutter I stuck here for more than 3 hours. Help me to solve this with a genuine solution. I tried to find the package and removed it from there but it didn’t solve.
2
Answers
Actually, the error says that Flutter SDK and that package use the same class DatePickerTheme,
If you want to use the same class from the package then use the import as below syntax:
then in code use the fdp.(your desired method from that package)
That’s it.
Happy Fluttering 💙
The DatPickerTheme class is defined in material/date_picker_theme.dart and also defined in package of dateTimePicker
use it like this: