You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@ryojiro did the work, in pubspec.yaml change the line flutter_datetime_picker: ^1.5.1 for those lines: flutter_datetime_picker: git: url: https://github.com/ryojiro/flutter_datetime_picker.git ref: 32ea47240c10469ad31db0084f5d9b7a12d16e01
Reacted by Techfis - Yen Nguyen
Reacted by Studio Tokicat, E Cuesy and Ashish Raturi
There are some bugs with this library ( flutter_datetime_picker )
/../../../.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';
'DatePickerTheme' is imported from both
is telling us two classes imported into the current file from different packages have the same name.
Dart cannot tell which to use, hence the error. Two common solutions
hide (don't import) one of the classes
Apply a prefix to one of the packages
Hide
Here's an example of hiding a single class from being imported from a package:
import 'package:text_widgets/text_widgets.dart' hide TextThemeExt;
Above the class named TextThemeExt won't be imported and won't clash with an identically named class in the current file.
Prefix
import 'dart:math' as math;
This is a very common prefix applied to the math library in dart. (So people reading the code understand these are symbols from the math library and not some short variable name in the current file.)
Any symbol within the math library now must be prefixed with math to be used.
For example:
Matrix4.rotationX(math.pi)
Without the prefix in the import statement the above would be:
Apply a prefix to one of the packages Hide Here's an example of hiding a single class from being imported from a package:
import 'package:text_widgets/text_widgets.dart' hide TextThemeExt; Above the class named TextThemeExt won't be imported and won't clash with an identically named class in the current file.
There are some bugs with this library ( flutter_datetime_picker )
/../../../.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';
'DatePickerTheme' is imported from both
is telling us two classes imported into the current file from different packages have the same name.
Dart cannot tell which to use, hence the error. Two common solutions
hide (don't import) one of the classes
Apply a prefix to one of the packages Hide Here's an example of hiding a single class from being imported from a package:
import 'package:text_widgets/text_widgets.dart' hide TextThemeExt; Above the class named TextThemeExt won't be imported and won't clash with an identically named class in the current file.
Prefix
import 'dart:math' as math;
This is a very common prefix applied to the math library in dart. (So people reading the code understand these are symbols from the math library and not some short variable name in the current file.)
Any symbol within the math library now must be prefixed with math to be used.
For example:
Matrix4.rotationX(math.pi) Without the prefix in the import statement the above would be:
I did all you said but I am facing the following problem for android emulator:
: Error: The parameter 'details' of the method '_TextFieldSelectionGestureDetectorBuilder.onSingleTapUp' has type 'TapUpDetails', which does not match the corresponding type, 'TapDragUpDetails', in the overridden method, 'TextSelectionGestureDetectorBuilder.onSingleTapUp'.
text_field.dart:108
'TapUpDetails' is from 'package:flutter/src/gestures/tap.dart' ('../../../../dev/flutter/packages/flutter/lib/src/gestures/tap.dart').
tap.dart:1
'TapDragUpDetails' is from 'package:flutter/src/widgets/tap_and_drag_gestures.dart' ('../../../../dev/flutter/packages/flutter/lib/src/widgets/tap_and_drag_gestures.dart').
tap_and_drag_gestures.dart:1
Change to a supertype of 'TapDragUpDetails', or, for a covariant parameter, a subtype.
void onSingleTapUp(TapUpDetails details) {
^
: Context: This is the overridden method ('onSingleTapUp').
text_selection.dart:2161
void onSingleTapUp(TapDragUpDetails details) {
^
: Error: The parameter 'details' of the method '_TextFieldSelectionGestureDetectorBuilder.onDragSelectionEnd' has type 'DragEndDetails', which does not match the corresponding type, 'TapDragEndDetails', in the overridden method, 'TextSelectionGestureDetectorBuilder.onDragSelectionEnd'.
text_field.dart:130
'DragEndDetails' is from 'package:flutter/src/gestures/drag_details.dart' ('../../../../dev/flutter/packages/flutter/lib/src/gestures/drag_details.dart').
drag_details.dart:1
'TapDragEndDetails' is from 'package:flutter/src/widgets/tap_and_drag_gestures.dart' ('../../../../dev/flutter/packages/flutter/lib/src/widgets/tap_and_drag_gestures.dart').
tap_and_drag_gestures.dart:1
Change to a supertype of 'TapDragEndDetails', or, for a covariant parameter, a subtype.
void onDragSelectionEnd(DragEndDetails details) {
^
: Context: This is the overridden method ('onDragSelectionEnd').
text_selection.dart:2839
for iOS simulator:
Error (Xcode): ../../../../.pub-cache/hosted/pub.dev/macos_ui-1.12.2/lib/src/fields/text_field.dart:108:35: Error: The parameter 'details' of the method '_TextFieldSelectionGestureDetectorBuilder.onSingleTapUp' has type 'TapUpDetails', which does not match the corresponding type, 'TapDragUpDetails', in the overridden method, 'TextSelectionGestureDetectorBuilder.onSingleTapUp'.
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(),);
Activity
PeterMX commentedon May 11, 2023
@ryojiro did the work, in pubspec.yaml change the line
flutter_datetime_picker: ^1.5.1for those lines:flutter_datetime_picker: git: url: https://github.com/ryojiro/flutter_datetime_picker.git ref: 32ea47240c10469ad31db0084f5d9b7a12d16e01jhandaya commentedon May 11, 2023
There are some bugs with this library ( flutter_datetime_picker )
/../../../.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';
'DatePickerTheme' is imported from both
is telling us two classes imported into the current file from different packages have the same name.
Dart cannot tell which to use, hence the error.
Two common solutions
Apply a prefix to one of the packages
Hide
Here's an example of hiding a single class from being imported from a package:
import 'package:text_widgets/text_widgets.dart' hide TextThemeExt;
Above the class named TextThemeExt won't be imported and won't clash with an identically named class in the current file.
import 'dart:math' as math;
This is a very common prefix applied to the math library in dart. (So people reading the code understand these are symbols from the math library and not some short variable name in the current file.)
Any symbol within the math library now must be prefixed with math to be used.
For example:
Matrix4.rotationX(math.pi)
Without the prefix in the import statement the above would be:
Matrix4.rotationX(pi)
library flutter_datetime_picker;
import 'dart:async';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_datetime_picker/src/datetime_picker_theme.dart';
import 'package:flutter_datetime_picker/src/date_model.dart';
import 'package:flutter_datetime_picker/src/i18n_model.dart';
export 'package:flutter_datetime_picker/src/datetime_picker_theme.dart';
export 'package:flutter_datetime_picker/src/date_model.dart';
export 'package:flutter_datetime_picker/src/i18n_model.dart';
HasanAlqaisi commentedon May 11, 2023
You can use my forked version (I just migrate it to flutter v3.10)
akaanuzman commentedon May 11, 2023
I did all you said but I am facing the following problem for android emulator:
: Error: The parameter 'details' of the method '_TextFieldSelectionGestureDetectorBuilder.onSingleTapUp' has type 'TapUpDetails', which does not match the corresponding type, 'TapDragUpDetails', in the overridden method, 'TextSelectionGestureDetectorBuilder.onSingleTapUp'.
text_field.dart:108
'TapUpDetails' is from 'package:flutter/src/gestures/tap.dart' ('../../../../dev/flutter/packages/flutter/lib/src/gestures/tap.dart').
tap.dart:1
'TapDragUpDetails' is from 'package:flutter/src/widgets/tap_and_drag_gestures.dart' ('../../../../dev/flutter/packages/flutter/lib/src/widgets/tap_and_drag_gestures.dart').
tap_and_drag_gestures.dart:1
Change to a supertype of 'TapDragUpDetails', or, for a covariant parameter, a subtype.
void onSingleTapUp(TapUpDetails details) {
^
: Context: This is the overridden method ('onSingleTapUp').
text_selection.dart:2161
void onSingleTapUp(TapDragUpDetails details) {
^
: Error: The parameter 'details' of the method '_TextFieldSelectionGestureDetectorBuilder.onDragSelectionEnd' has type 'DragEndDetails', which does not match the corresponding type, 'TapDragEndDetails', in the overridden method, 'TextSelectionGestureDetectorBuilder.onDragSelectionEnd'.
text_field.dart:130
'DragEndDetails' is from 'package:flutter/src/gestures/drag_details.dart' ('../../../../dev/flutter/packages/flutter/lib/src/gestures/drag_details.dart').
drag_details.dart:1
'TapDragEndDetails' is from 'package:flutter/src/widgets/tap_and_drag_gestures.dart' ('../../../../dev/flutter/packages/flutter/lib/src/widgets/tap_and_drag_gestures.dart').
tap_and_drag_gestures.dart:1
Change to a supertype of 'TapDragEndDetails', or, for a covariant parameter, a subtype.
void onDragSelectionEnd(DragEndDetails details) {
^
: Context: This is the overridden method ('onDragSelectionEnd').
text_selection.dart:2839
void onDragSelectionEnd(TapDragEndDetails details) {
^
Target kernel_snapshot failed: Exception
for iOS simulator:
Error (Xcode): ../../../../.pub-cache/hosted/pub.dev/macos_ui-1.12.2/lib/src/fields/text_field.dart:108:35: Error: The parameter 'details' of the method '_TextFieldSelectionGestureDetectorBuilder.onSingleTapUp' has type 'TapUpDetails', which does not match the corresponding type, 'TapDragUpDetails', in the overridden method, 'TextSelectionGestureDetectorBuilder.onSingleTapUp'.
8thgencore commentedon May 11, 2023
I found new project, forked this
https://pub.dev/packages/flutter_datetime_picker_plus
ahmednfwela commentedon May 12, 2023
We have a fork up and running that's compatible with flutter 3.10
https://github.com/Bdaya-Dev/flutter_datetime_picker
https://pub.dev/packages/flutter_datetime_picker_bdaya
lucasjinreal commentedon Nov 19, 2023
@ahmednfwela thanks for your work but please do not just repost other's lib directly to pub by change the lib name.
You will force others change their code too, you can just fork and tell how to use it in git.
ahmednfwela commentedon Nov 19, 2023
@lucasjinreal if pub allowed to publish packages that contain git dependencies, I wouldn't need to do this.
there's a lot of form packages that depend on this package.
AnasYounus commentedon May 24, 2024
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