Skip to main content

How do I solve version conflicts of packages for different flutter versions?

When integrating the likeminds_chat_flutter_core SDK into your Flutter project, you might encounter package version conflicts, particularly with dependencies like extended_text_field, file_picker, and js. These conflicts often arise due to compatibility issues between specific package versions and the Flutter SDK version you're using.

To address these conflicts, you can utilize the dependency_overrides section in your pubspec_overrides.yaml file. This allows you to specify exact versions of dependencies, ensuring compatibility with your Flutter SDK version.

Below is a table outlining the recommended versions of extended_text_field, file_picker, and js for various Flutter SDK versions:

Flutter SDK Version Rangeextended_text_fieldfile_pickerjs
3.19.0 ≤ version < 3.22.0^14.0.08.0.4
3.22.0 ≤ version < 3.24.0^15.0.0^0.7.1
3.24.0 ≤ version < 3.29.3^16.0.0^0.7.1

Note: The file_picker package is only required for Flutter versions between 3.19.0 and 3.22.0.

Implementing Dependency Overrides

To apply these overrides, add the following to your pubspec_overrides.yaml file, adjusting the versions based on your Flutter SDK version:

For Flutter 3.19.0 ≤ version < 3.22.0:

dependency_overrides:
extended_text_field: ^14.0.0
file_picker: 8.0.4

For Flutter 3.22.0 ≤ version < 3.24.0:

dependency_overrides:
extended_text_field: ^15.0.0
js: ^0.7.1

For Flutter 3.24.0 ≤ version < 3.29.3:

dependency_overrides:
extended_text_field: ^16.0.0
js: ^0.7.1

Important: Ensure that the pubspec_overrides.yaml file is located at the root of your Flutter project, alongside the pubspec.yaml file.

Additional Resources

For more information on the extended_text_field package and its compatibility with different Flutter versions, refer to the official documentation:

By aligning your dependency versions with your Flutter SDK version, you can mitigate compatibility issues and ensure a smoother development experience with the likeminds_chat_flutter_core SDK.