Realank / flutter_datetime_picker

a date time picker in flutter
MIT License
608 stars 719 forks source link

Conflict of DatePickerTheme Import Names Causing Build Errors #338

Open cguarchaj opened 3 months ago

cguarchaj commented 3 months ago

I am experiencing build errors related to the DatePickerTheme import in the flutter_datetime_picker package. It seems there's a conflict because DatePickerTheme is imported from both package:flutter/src/material/date_picker_theme.dart and package:flutter_datetime_picker/src/datetime_picker_theme.dart. This conflict prevents the package from being used as it generates an error on build. Here are the error messages I receive:

  1. Error: 'DatePickerTheme' is imported from both 'package:flutter/src/material/date_picker_theme.dart' and 'package:flutter_datetime_picker/src/datetime_picker_theme.dart'.

Could a resolution involve modifying the internal imports within the package or is there an alternative fix available?

AnasYounus commented 1 month ago

This is because of a conflict where we use flutter_datetime_picker: ^1.5.1 (since it has an analysis issue as well). See https://pub.dev/packages/flutter_datetime_picker/versions Remove flutter_datetime_picker:^1.5.1 from your pubspec.yaml and use Flutter builti-n DateTime Package which is given below. showTimePicker(context: context, initialTime: TimeOfDay.now(),);

Please Support Flutter