Skip to content

DatePickerTheme is imported from both #332

Description

@AndOs-03

../../../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

Activity

  1. hz0571 commented on Nov 18, 2023

    @hz0571

    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'.

  2. awiprayitno commented on Nov 23, 2023

    @awiprayitno

    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(),
    
  3. Jephtha commented on Dec 3, 2023

    @Jephtha

    anyone gotten a fix for this?

  4. afhslll commented on Dec 7, 2023

    @afhslll

    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.

  5. AndOs-03 commented on Dec 7, 2023

    @AndOs-03
    Author

    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

  6. ringonotts commented on Dec 10, 2023

    @ringonotts

    @AndOs-03 which lib did you choose please ?

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

  7. AndOs-03 commented on Dec 12, 2023

    @AndOs-03
    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

  8. added a commit that references this issue on Jan 1, 2024
  9. zwwhappy commented on Jan 4, 2024

    @zwwhappy

    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;

  10. 2000zua commented on Mar 26, 2024

    @2000zua

    ../../../../../.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(),

  11. arthurshir commented on Aug 5, 2024

    @arthurshir
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions