1

The current Dart SDK version is 3.0.6. Because date_time_picker >=2.0.0 depends on intl ^0.17.0 and date_time_picker <2.0.0 doesn't support null safety, every version of date_time_picker requires intl ^0.17.0. And because every version of flutter_localizations from sdk depends on intl 0.18.0, date_

When i type pub get the error between these packages occur

description: A new Flutter application.

publish_to: 'none' # Remove this line if you wish to publish to pub.dev

version: 1.6.0+1

environment:
  sdk: ">=2.18.0 <4.0.0"

dependencies:
  flutter:
    sdk: flutter
  flutter_localizations:
    sdk: flutter

  app_settings: any
  badges: any
  barcode_scan2: any
  cached_network_image: any
  #  call_log: any
  connectivity: any
#  cron: any
  cupertino_icons: any
  date_time_picker: any
  dio: any
  flutter_html_to_pdf: any
  flutter_kurdish_localization: ^1.0.1
  fluttertoast: any
  geolocator: 8.2.1
  awesome_dialog: any
  flutter_speed_dial: any
dev_dependencies:
  flutter_test:
    sdk: flutter
  flutter_launcher_icons: any

flutter_icons:
  android: "launcher_icon"
  image_path: "assets/icon/pos.png"

flutter:

  uses-material-design: true
  assets:
    - assets/images/
    - i18n/
  

I tried changing sdk environment but did succeed. Please help

1 Answers1

1

Each version of date_time_picker is using intl 0.17.0. while each version of flutter_localizations is using intl 0.18.0. The issue occurs because the intl package is not match.

Even if you don't add the intl package to your project dependencies. But flutter_localizations and date_time_picker use package intl, so if there are several packages that use packages with different versions, this conflict can occur. You can check the package depedencies on the right side (check the image below).

Depedencies info.

There are several ways to solve this problem:

  1. Ask the authors to update his package to use a newer intl version. But there are users who have asked to update the package due to a similar error as you asked https://github.com/m3uzz/date_time_picker/issues/85

  2. Fork the date_time_picker repository and update the intl version by yourself.

  3. Downgrade the flutter sdk.

Septian Dika
  • 446
  • 5
  • 17