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

DatePickerTheme is imported from both #332

Open
AndOs-03 opened this issue Oct 28, 2023 · 11 comments
Open

DatePickerTheme is imported from both #332

AndOs-03 opened this issue Oct 28, 2023 · 11 comments

Comments

@AndOs-03
Copy link

../../../AppData/Local/Pub/Cache/hosted/pub.dev/flutter_datetime_picker-1.5.1/lib/flutter_datetime_picker.dart:6: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'.
import 'package:flutter_datetime_picker/src/datetime_picker_theme.dart';
^^^^^^^^^^^^^^^
../../../AppData/Local/Pub/Cache/hosted/pub.dev/flutter_datetime_picker-1.5.1/lib/flutter_datetime_picker.dart:199:31: Error: 'DatePickerTheme' is imported from both 'package:flutter/src/material/date_picker_theme.dart' and 'package:flutter_datetime_picker/src/datetime_picker_theme.dart'.
this.theme = theme ?? DatePickerTheme(),

I've use an alias like this import 'package:flutter_datetime_picker/flutter_datetime_picker.dart' as datepickerrr; but not work.
I use flutter_datetime_picker: ^1.5.1 flutter_windows_3_13_9

@developer-jbulls
Copy link

Same. getting this:
Performing hot restart... Syncing files to device iPhone 15 Pro Max... ../../.pub-cache/hosted/pub.dev/flutter_datetime_picker-1.5.1/lib/flutter_datetime_picker.dart:6: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'. import 'package:flutter_datetime_picker/src/datetime_picker_theme.dart'; ^^^^^^^^^^^^^^^ ../../.pub-cache/hosted/pub.dev/flutter_datetime_picker-1.5.1/lib/flutter_datetime_picker.dart:199:31: Error: 'DatePickerTheme' is imported from both 'package:flutter/src/material/date_picker_theme.dart' and 'package:flutter_datetime_picker/src/datetime_picker_theme.dart'. this.theme = theme ?? DatePickerTheme(), ^^^^^^^^^^^^^^^ Restarted application in 1,034ms.

@hz0571
Copy link

hz0571 commented Nov 18, 2023

Same. getting this:
Could not build the precompiled application for the device.
Error (Xcode): ../../.pub-cache/hosted/pub.dev/flutter_datetime_picker-1.5.1/lib/flutter_datetime_picker.dart:6: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'.

@awiprayitno
Copy link

same here

: Error: 'DatePickerTheme' is imported from both 'package:flutter/src/material/date_picker_theme.dart' and 'package:flutter_datetime_picker/src/datetime_picker_theme.dart'.
flutter_datetime_picker.dart:6
import 'package:flutter_datetime_picker/src/datetime_picker_theme.dart';
datetime_picker_theme.dart: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'.
flutter_datetime_picker.dart:199
        this.theme = theme ?? DatePickerTheme(),

@Jephtha
Copy link

Jephtha commented Dec 3, 2023

anyone gotten a fix for this?

@afhslll
Copy link

afhslll commented Dec 7, 2023

I got same issue. For me, I edited the library directly. In flutter_datetime_picker.dart, add 'as' in the 'import'.

library flutter_datetime_picker;
import 'package:flutter_datetime_picker/src/datetime_picker_theme.dart' as dpt;

Then, change DatePickerTheme to dpt.DatePickerTheme.

@AndOs-03
Copy link
Author

AndOs-03 commented Dec 7, 2023

The best solution currently would be to directly edit flutter_datetime_picker.dart by adding an alias. I saw a merge request to fix this problem but it seems to me that the repository admins abandoned it. I moved to another library

@ringonotts
Copy link

@AndOs-03 which lib did you choose please ?

So can we assume this library is dead then ? Real shame if it is....

@AndOs-03
Copy link
Author

@AndOs-03 which lib did you choose please ?

So can we assume this library is dead then ? Real shame if it is....

@ringonotts I used flutter_datetime_picker_plus

katmakhan added a commit to katmakhan/flutter_datetime_picker that referenced this issue Jan 1, 2024
@zwwhappy
Copy link

zwwhappy commented Jan 4, 2024

I got same issue. For me, I edited the library directly. In flutter_datetime_picker.dart, add 'as' in the 'import'.

library flutter_datetime_picker; import 'package:flutter_datetime_picker/src/datetime_picker_theme.dart' as dpt;

Then, change DatePickerTheme to dpt.DatePickerTheme.

or Edited the library directly. In flutter_datetime_picker.dart, hide DatePickerTheme in the 'import'.
imported 'package:flutter/src/material/date_picker_theme.dart' hide DatePickerTheme;

@2000zua
Copy link

2000zua commented Mar 26, 2024

../../../../../.pub-cache/hosted/pub.dev/flutter_datetime_picker-1.5.1/lib/flutter_datetime_picker.dart:6: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'.
import 'package:flutter_datetime_picker/src/datetime_picker_theme.dart';
^^^^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/flutter_datetime_picker-1.5.1/lib/flutter_datetime_picker.dart:199:31: Error: 'DatePickerTheme' is imported
from both 'package:flutter/src/material/date_picker_theme.dart' and 'package:flutter_datetime_picker/src/datetime_picker_theme.dart'.
this.theme = theme ?? DatePickerTheme(),

@arthurshir
Copy link

arthurshir commented Aug 5, 2024

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

9 participants