Flutter libraries incompatibility - flutter

I'm working on a flutter project which I'm not the one who developed it first time. After running pub get I have these massive amount of errors:
Because xdg_directories >=0.1.2 <0.2.0-nullsafety.0 depends on process >=3.0.12 <5.0.0 and xdg_directories <0.1.2 depends on process ^3.0.12, xdg_directories <0.2.0-nullsafety.0 requires process >=3.0.12 <5.0.0.
(1) So, because path_provider_linux <0.2.0-nullsafety depends on xdg_directories ^0.1.0, path_provider_linux <0.2.0-nullsafety requires process >=3.0.12 <5.0.0.
Because process >=4.0.0-nullsafety.1 <4.0.0-nullsafety.4 requires SDK version >=2.10.0-0.0 <2.12.0 and process >=4.0.0-nullsafety.4 <4.0.0 depends on platform ^3.0.0-nullsafety.4, process >=4.0.0-nullsafety.1 <4.0.0 requires platform ^3.0.0-nullsafety.4.
And because process >=3.0.12 <4.0.0-nullsafety.1 depends on intl >=0.14.0 <0.17.0 and process >=4.0.0 depends on platform ^3.0.0, process >=3.0.12 requires platform ^3.0.0-nullsafety.4 or intl >=0.14.0 <0.17.0.
(2) So, because path_provider_linux <0.2.0-nullsafety requires process >=3.0.12 <5.0.0 (1), path_provider_linux <0.2.0-nullsafety requires platform ^3.0.0-nullsafety.4 or intl >=0.14.0 <0.17.0.
Because shared_preferences_linux <=0.0.2 depends on path_provider ^1.6.11 and shared_preferences_linux >=0.0.4-nullsafety <2.0.0 depends on shared_preferences_platform_interface ^2.0.0-nullsafety, shared_preferences_linux <0.0.2+1 or >=0.0.4-nullsafety <2.0.0-∞ requires path_provider ^1.6.11 or shared_preferences_platform_interface ^2.0.0-nullsafety.
And because shared_preferences_linux >=0.0.2+1 <0.0.4-nullsafety depends on path_provider_linux ^0.0.1 and path_provider >=1.6.10 <2.0.0-nullsafety depends on path_provider_linux ^0.0.1, shared_preferences_linux <2.0.0 requires shared_preferences_platform_interface ^2.0.0-nullsafety or path_provider_linux ^0.0.1.
And because path_provider_linux <0.2.0-nullsafety requires platform ^3.0.0-nullsafety.4 or intl >=0.14.0 <0.17.0 (2), shared_preferences_linux <2.0.0 requires platform ^3.0.0-nullsafety.4 or intl >=0.14.0 <0.17.0 or shared_preferences_platform_interface ^2.0.0-nullsafety.
And because every version of flutter_localizations from sdk depends on intl 0.17.0 and shared_preferences >=0.5.8 <2.0.0-nullsafety depends on shared_preferences_linux ^0.0.2, if flutter_localizations any from sdk and shared_preferences >=0.5.8 <2.0.0-nullsafety then platform ^3.0.0-nullsafety.4 or shared_preferences_platform_interface ^2.0.0-nullsafety.
And because shared_preferences >=0.5.4+8 <2.0.0-nullsafety depends on shared_preferences_platform_interface ^1.0.0 and every version of localize_and_translate depends on flutter_localizations any from sdk, if shared_preferences >=0.5.8 <2.0.0-nullsafety and localize_and_translate any then platform ^3.0.0-nullsafety.4.
And because localize_and_translate ^3.0.3 depends on shared_preferences ^0.5.12+4 and firebase_messaging >=0.2.0 <7.0.2 depends on platform ^2.0.0, localize_and_translate ^3.0.3 is incompatible with firebase_messaging >=0.2.0 <7.0.2.
So, because educationtqnia depends on both firebase_messaging ^6.0.13 and localize_and_translate ^3.0.3, version solving failed.
pub get failed (1; So, because educationtqnia depends on both firebase_messaging ^6.0.13 and localize_and_translate ^3.0.3, version solving failed.)
Process finished with exit code 1
This is my pubspec-yaml file:
name: educationtqnia
description: education_tqnia
# The following line prevents the package from being accidentally published to
# pub.dev using `pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.0+7
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
permission_handler: ^5.0.0+hotfix.4
dio: ^3.0.8
firebase_messaging: ^6.0.13
flutter_local_notifications: ^1.1.3
connectivity: ^0.4.8+2
video_player: ^0.10.9+1
image_picker: ^0.6.5+3
cupertino_icons: ^0.1.3
http: ^0.12.0+2
flutter_launcher_icons: ^0.7.2+1
flutter_rounded_date_picker: 0.3.0
rflutter_alert: ^1.0.2
intro_slider: ^2.2.9
font_awesome_flutter: ^8.8.1
shared_preferences: ^0.5.6+3
fluttertoast: ^4.0.0
percent_indicator: ^2.1.1+1
responsive_builder: ^0.1.5
chewie: ^0.9.10
wc_flutter_share: ^0.2.0
flutter_record: ^0.4.3+1
cached_network_image: ^2.2.0
gradient_text: ^1.0.2
flutter_youtube: "^2.0.0"
flutter_pdfview: ^1.0.3+2
url_launcher: ^5.5.0
webview_flutter: ^1.0.7
full_screen_image: any
dev_dependencies:
flutter_test:
sdk: flutter
localize_and_translate: ^3.0.3
flutter_icons:
android: "launcher_icon"
ios: true
image_path: "assets/icon/icon.png"
flutter_zoom_plugin:
git:
url: git://github.com/decodedhealth/flutter_zoom_plugin.git
ref: 0.0.8
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
# The following section is specific to Flutter.
flutter:
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true
# To add assets to your application, add an assets section, like this:
assets:
- langs/ar.json
- langs/en.json
- assets/
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware.
# For details regarding adding assets from package dependencies, see
# https://flutter.dev/assets-and-images/#from-packages
# To add custom fonts to your application, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
fonts:
- family: Cairo
fonts:
- asset: assets/fonts/Cairo-Black.ttf
- asset: assets/fonts/Cairo-Bold.ttf
- asset: assets/fonts/Cairo-ExtraLight.ttf
- asset: assets/fonts/Cairo-Light.ttf
- asset: assets/fonts/Cairo-Regular.ttf
- asset: assets/fonts/Cairo-SemiBold.ttf
#
# For details regarding fonts from package dependencies,
# see https://flutter.dev/custom-fonts/#from-packages
I tried downgrading the flutter SDK, switching between channels and running changing the libraries version to solve the problem but nothing work. Any ideas how to solve this problem?
Thanks.

This problem is very common when Flutter or some plugins have been updated. The only thing that works for me is to update everything, both flutter and the plugins to their latest version and if one is incompatible because it has no maintenance, try to change it for another.

Adding to Miguels answers - you could file issues on the relevant libraries GitHub pages if you need them to be usable on the newest flutter version aswell as compatible with other libraries.

Related

flutter location package version conflict with google_map_location_picker

I download a source code from codecanyone but
I am facing the following issue when adding google_map_location_picker package
Because location 4.3.0 depends on location_platform_interface ^2.3.0 and no versions of location_platform_interface match >2.3.0 <3.0.0, location 4.3.0 requires location_platform_interface 2.3.0.
And because location_platform_interface 2.3.0 depends on plugin_platform_interface ^2.0.0 and geolocator_platform_interface <2.0.0-nullsafety.0 depends on plugin_platform_interface ^1.0.2, location 4.3.0 is incompatible with geolocator_platform_interface <2.0.0-nullsafety.0.
And because google_map_location_picker >=4.1.3 depends on geolocator ^6.1.14 which depends on geolocator_platform_interface ^1.0.8, location 4.3.0 is incompatible with google_map_location_picker >=4.1.3.
So, because markets depends on both google_map_location_picker 4.1.7 and location 4.3.0, version solving failed.
pub get failed (1; So, because markets depends on both google_map_location_picker 4.1.7 and location 4.3.0, version solving failed.)
here is my pubspec.yaml file
name: markets
description: markets
# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 2.2.0
environment:
sdk: ">=2.2.2 <3.0.0"
module:
androidX: true
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: 1.0.4
google_maps_flutter: 2.1.1
google_map_location_picker: 4.1.7
mvc_pattern: 6.6.4+2
global_configuration: 2.0.0-nullsafety.1
html: 0.15.0
shared_preferences: 2.0.13
flutter_html: 3.0.0-alpha.2
flutter_svg: 1.0.3
location: 4.3.0
webview_flutter: 3.0.0
url_launcher: 6.0.20
cached_network_image: 3.2.0
fluttertoast: 8.0.8
flutter_staggered_grid_view: 0.4.0-nullsafety.3
intl_utils: 2.6.1
carousel_slider: 4.0.0
cloud_firestore: 3.1.8
firebase_auth: 3.3.7
firebase_core: 1.12.0
firebase_messaging: 11.2.6
firebase_storage: 8.0.0
image_picker: 0.7.5+4
string_validator: 0.3.0
platform: 3.1.0
dev_dependencies:
flutter_test:
sdk: flutter
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
# The following section is specific to Flutter.
flutter:
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true
# To add assets to your application, add an assets section, like this:
assets:
- assets/cfg/
- assets/img/
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware.
# For details regarding adding assets from package dependencies, see
# https://flutter.dev/assets-and-images/#from-packages
# To add custom fonts to your application, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
fonts:
- family: ProductSans
fonts:
- asset: assets/fonts/ProductSans-Thin.ttf
weight: 100
- asset: assets/fonts/ProductSans-Thin.ttf
weight: 200
- asset: assets/fonts/ProductSans-Light.ttf
weight: 300
- asset: assets/fonts/ProductSans-Regular.ttf
weight: 400
- asset: assets/fonts/ProductSans-Medium.ttf
weight: 500
- asset: assets/fonts/ProductSans-Bold.ttf
weight: 600
- asset: assets/fonts/ProductSans-Black.ttf
weight: 700
- asset: assets/fonts/ProductSans-Black.ttf
weight: 800
- asset: assets/fonts/ProductSans-Black.ttf
weight: 900
# - family: Trajan Pro
# fonts:
# - asset: assets/fonts/TrajanPro.ttf
# - asset: assets/fonts/TrajanPro_Bold.ttf
# weight: 700
#
# For details regarding fonts from package dependencies,
# see https://flutter.dev/custom-assets/fonts/#from-packages
flutter_intl:
enabled: true
You've just stumbled upon a Dependency Hell. google_map_location_picker is pretty old now (16 months already) and it uses outdated versions of other packages that some dependencies from the pubspec.yaml depends on itself.
If you remove google_map_location_picker from the dependencies everything installs smoothly. Your best option then would be to fork google_map_location_picker and change the dependencies yourself and point its dependency in the pubspec.yaml to this fork of yours.
To add the fork as a dependency, for example from Github, do something like this:
dependencies:
flutter:
sdk: flutter
carousel_pro:
git:
url: git://github.com/your_account/google_map_location_picker_fork.git
ref: main # branch name

Facing the issue in pubspec.yaml

When i integrate the library new_version: ^0.2.0 in the project after pub get i get this error -
Because new_version >=0.0.7 depends on package_info_plus ^1.0.0 which depends on package_info_plus_platform_interface ^1.0.0, new_version >=0.0.7 requires package_info_plus_platform_interface ^1.0.0.
And because package_info_plus_platform_interface >=1.0.0-nullsafety.1 depends on plugin_platform_interface ^2.0.0 and file_picker 2.1.6 depends on plugin_platform_interface ^1.0.1, new_version >=0.0.7 is incompatible with file_picker 2.1.6.
So, because fstore depends on both file_picker 2.1.6 and new_version ^0.2.0, version solving failed.
pub get failed (1; So, because fstore depends on both file_picker 2.1.6 and new_version ^0.2.0, version solving failed.)
I don't understand what does it mean is this flutter version issue or sdk issue???
Here is the pubspec.yaml file where all the library has been integrate for the project, if i remove the new_version library project will work perfectly fine.
name: fstore
publish_to: "none"
description: Mobile commerce app by Flutter
# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 2.0.0+3001
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
# COMMON
inspireui:
path: ./modules/common_library
pedantic: 1.9.2
rubber:
git:
url: git://github.com/inspireui/rubber
country_pickers:
git:
url: git://github.com/inspireui/country_pickers.git
# FIREBASE PACKAGES
cloud_firestore: 0.14.4
firebase_analytics: 6.3.0
firebase_auth: 0.18.4+1
firebase_core: 0.5.3
firebase_database: 4.4.0
firestore_ui: 1.12.0
firebase_remote_config: ^0.4.3
# STATE MANAGEMENT
provider: 4.3.3
# UI
animated_splash: 1.0.0
animated_text_kit: 3.1.2
animations: 1.1.2
awesome_card: 1.1.0
carousel_pro: 1.0.0
configurable_expansion_tile: 1.0.0
country_code_picker: 1.7.0
custom_splash: 0.0.2
flare_splash_screen: 3.0.1
rive: 0.6.8
flash: 1.3.2
flutter_spinkit: 4.1.2+1
flutter_staggered_grid_view: 0.3.4
flutter_statusbarcolor: 0.2.3
flutter_swiper: 1.1.6
visibility_detector: 0.1.5
font_awesome_flutter: 8.11.0
image_picker: 0.6.7+15
file_picker: 2.1.6
multi_image_picker: 4.7.15
intro_slider: 2.3.4
liquid_swipe: 1.5.0
page_indicator: 0.3.0
percent_indicator: 2.1.9+1
pin_code_fields: 6.1.0
pull_to_refresh: 1.6.4
rate_my_app: 0.7.2
sticky_headers: 0.1.8+1
zoom_widget: 0.1.3
cupertino_icons: any
# WEB TOOLS
video_player: 2.0.0
html_unescape: 1.0.2
webview_flutter: 2.0.1
flutter_widget_from_html: 0.6.0-rc.2021030401
flutter_webview_plugin: 0.3.11
responsive_builder: 0.3.0
# MAP
google_maps_flutter: 1.2.0
location: 2.3.5 # use this version to compatible with fluxbuilder
# STORAGE
localstorage: 3.0.6+9 # depend on google font
shared_preferences: 2.0.3
# CONNECTIVITY
connectivity: 2.0.2
http: 0.13.0
http_auth: 0.3.1
uni_links: 0.4.0
firebase_dynamic_links: 0.6.3
# AUTHENTICATION
apple_sign_in: 0.1.0
flutter_facebook_login: 3.0.0
google_sign_in: 4.5.6
# PUSH NOTIFICATION
firebase_messaging: 7.0.3
notification_permissions: 0.4.8
onesignal_flutter: 2.6.2
# PAYMENTS
stripe_sdk:
git:
url: git://github.com/inspireui/stripe-sdk.git
razorpay_flutter: 1.2.3
# IMAGES
extended_image:
git:
url: git://github.com/inspireui/extended_image.git
transparent_image: 1.0.0
# ADS
facebook_audience_network: 0.7.1
firebase_admob: 0.10.3
# IN APP
new_version: ^0.2.0
# TOOLS
auto_size_text: 2.1.0
event_bus: 1.1.1
google_fonts: 2.0.0
random_string: 2.1.0
share: 0.6.5+4
sms_autofill: 1.3.1
json_annotation: 3.1.1
timeago: 3.0.1
universal_platform: ^0.1.3
uuid: 3.0.1
validate: 1.7.0
vector_math: any
async: 2.5.0
easy_debounce: 1.0.2
jwt_decoder: 1.0.4
charts_flutter: 0.9.0
flutter_image_compress: ^0.7.0
encrypt: 4.1.0
adaptive_breakpoints: 0.0.3
intl: 0.17.0
# For Shopify GraphQL
graphql: 3.1.0
flutter_localizations:
sdk: flutter
dev_dependencies:
flutter_test:
sdk: flutter
version: any
flutter_launcher_icons: 0.8.1
mockito: ^4.1.1 # Testing
#To run json serializer, run:
# flutter pub run build_runner build --build-filter="lib/models/serializers/*.dart" --delete-conflicting-outputs
# flutter pub run build_runner serve --build-filter="lib/models/serializers/*.dart"
build_runner: 1.11.1
json_serializable: 3.5.1
### Override the library to support Flutter 2.0
### Note: This will show the warning but will not impact to the app features 👍
dependency_overrides:
intl: 0.17.0
http: 0.13.0
crypto: 3.0.0
path_provider: 2.0.1
uuid: 3.0.1
http_parser: 4.0.0
shared_preferences: 2.0.3
pedantic: 1.9.2
flutter_svg: 0.19.3
extended_image:
git:
url: git://github.com/inspireui/extended_image.git
url_launcher: 6.0.1
cached_network_image: 2.5.0
fwfh_cached_network_image: ^0.6.0-rc.2021030401
modal_bottom_sheet: 2.0.0-nullsafety.1
# Run this script to generate the app icon: flutter pub run flutter_launcher_icons:main
flutter_icons:
android: "launcher_icon"
ios: true
image_path: "assets/images/app_icon.png"
# For information on the generic Dart part of this file, see the
# following page: https://www.dartlang.org/tools/pub/pubspec
# The following section is specific to Flutter.
flutter:
uses-material-design: true
assets:
- lib/config/
- lib/config/mocks/
- lib/config/states/
- lib/config/stories/
- assets/icons/categories/
- assets/icons/tabs/
- assets/icons/payment/
- assets/images/
- assets/images/country/
- assets/images/favicon/
- assets/html/
- assets/google_fonts/
fonts:
- family: Feather
fonts:
- asset: assets/fonts/Feather.ttf
- family: SF Pro Display
fonts:
- asset: assets/fonts/SF-Pro-Display-Semibold.otf
weight: 700
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.io/assets-and-images/#resolution-aware.
# For details regarding adding assets from package dependencies, see
# https://flutter.io/assets-and-images/#from-packages
# To add custom fonts to your application, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
#
# For details regarding fonts from package dependencies,
# see https://flutter.io/custom-fonts/#from-packages
flutter_intl:
enabled: true
You can do sth like this to force using a specific version
dependency_overrides:
package_info_plus_platform_interface: ^1.0.0
or
dependency_overrides:
plugin_platform_interface: ^2.0.0
Just write new_version: any, and get the pub. After that, get the suitable version from pubspec.lock. You will get the solusion.

Why I can not add some packages to pubspec.yaml file?

When I try to add flutter_sound: ^7.7.0+1 to dependencies in pubspec.yaml and press to "pub get",,I recieve error message below, How can I solve this issue??
pubspec.yaml
name: lezzet_kitabi
description: A new Flutter application.
# The following line prevents the package from being accidentally published to
# pub.dev using `pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.0+1
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.2
bordered_text: ^1.0.1
sqflite: ^1.3.0
path_provider: ^1.6.27
provider: ^4.3.3
integration_test: ^1.0.2+2
camera: 0.5.8+17
image_picker: ^0.6.7+22
path: ^1.8.0
flutter_sound: ^7.7.0+1
dev_dependencies:
flutter_test:
sdk: flutter
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
# The following section is specific to Flutter.
flutter:
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true
# To add assets to your application, add an assets section, like this:
assets:
- images/logoBGopacity.png
- images/logoBG.png
- images/cuttedlogo.PNG
- images/sticker0.png
- images/sticker1.png
- images/sticker2.png
- images/sticker3.png
- images/sticker4.png
- images/sticker5.png
- images/sticker6.png
- images/sticker7.png
- images/sticker8.png
- images/sticker9.png
- images/sticker10.png
- images/sticker11.png
- images/sticker12.png
- images/sticker13.png
- images/sticker14.png
- images/sticker15.png
- images/sticker16.png
- images/sticker17.png
- images/sticker18.png
- images/sticker19.png
- images/sticker20.png
- images/sticker21.png
- images/sticker22.png
- images/stickerForRecipeScreen.png
fonts:
- family: Marck
fonts:
- asset: fonts/MarckScript-Regular.ttf
- family: Graduate
fonts:
- asset: fonts/Graduate-Regular.ttf
- family: OpenSans
fonts:
- asset: fonts/OpenSansCondensed-Light.ttf
#
# For details regarding fonts from package dependencies,
# see https://flutter.dev/custom-fonts/#from-packages
Error
Because flutter_sound >=6.4.3+42 depends on uuid ^2.2.2 which depends on crypto ^2.0.0, flutter_sound >=6.4.3+42 requires crypto ^2.0.0.
And because every version of flutter_driver from sdk depends on crypto 3.0.0, flutter_sound >=6.4.3+42 is incompatible with flutter_driver from sdk.
And because integration_test 1.0.2+2 depends on flutter_driver any from sdk and no versions of integration_test match >1.0.2+2 <2.0.0, flutter_sound >=6.4.3+42 is incompatible with integration_test ^1.0.2+2.
So, because lezzet_kitabi depends on both integration_test ^1.0.2+2 and flutter_sound ^7.7.0+1, version solving failed.
pub get failed (1; So, because lezzet_kitabi depends on both integration_test ^1.0.2+2 and flutter_sound ^7.7.0+1, version solving failed.)
This problem is due to your project's dependencies depending on other packages.
There is a conflict in their versioning which can be resolved, as per the documentation.
You can read about it here (Official Flutter Docs).

Dependence incompatible in my flutter project

[source] flutter.bat pub get
Running "flutter pub get" in source...
Because rate_my_app >=0.6.0+3 depends on shared_preferences ^0.5.7 and fstore depends on shared_preferences 0.5.3+4, rate_my_app >=0.6.0+3 is forbidden.
So, because fstore depends on rate_my_app ^0.6.1+2, version solving failed.
pub get failed (1; So, because fstore depends on rate_my_app ^0.6.1+2, version solving failed.)
exit code 1
Here is my pubspec.yaml:
name: fstore
description: Mobile commerce app by Flutter
# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# `enter code here`https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.3.0+1
environment:
sdk: ">=2.2.2 <3.0.0"
dependencies:
logs:
git: https://github.com/pq/logs
flutter:
sdk: flutter
intl: 0.16.1
http: 0.12.0+2
html_unescape: 1.0.1+3
provider: ^3.0.0+1
flutter_signin_button: ^0.2.8
after_layout: 1.0.7+2
font_awesome_flutter: ^8.5.0
path: 1.7.0
flutter_facebook_login: ^2.0.1
flutter_account_kit: 0.7.0
vector_math: 2.0.8
carousel_pro: ^1.0.0
flutter_widget_from_html_core: ^0.2.2+1
configurable_expansion_tile: ^1.0.0
timeago: ^2.0.18
share: ^0.6.2+1
validate: ^1.7.0
country_pickers: ^1.1.0
shared_preferences: ^0.5.7
firebase_messaging: 5.1.2
firebase_analytics: 4.0.2
transparent_image: 1.0.0
pull_to_refresh: ^1.5.0
localstorage: ^2.0.0
notification_permissions: ^0.4.0
flare_splash_screen: 2.1.3
rate_my_app: ^0.6.0+3
flutter_range_slider: ^1.3.1
page_indicator: ^0.2.0
global_configuration: ^1.1.0
extended_image: 0.5.3
flutter_screenutil: 0.5.3
fluttertoast: ^3.1.0
intro_slider: ^2.2.5
url_launcher: ^5.1.0
firebase_core: ^0.4.0+8
firebase_auth: ^0.11.1+12
cloud_firestore: ^0.12.7+1
firestore_ui: ^1.6.0
flutter_webview_plugin: ^0.3.5
connectivity: ^0.4.3+6
random_string: ^1.1.0
google_maps_flutter: 0.5.19+2
place_picker: 0.9.8
cached_network_image: ^2.0.0-rc
firebase_storage: ^3.0.4
image_picker: ^0.6.0+17
fab_circular_menu: 0.1.1
uuid: ^2.0.2
flutter_localizations:
sdk: flutter
dev_dependencies:
flutter_launcher_icons: ^0.7.2+1
flutter_test:
sdk: flutter
# Run this script to generate the app icon: flutter pub pub run flutter_launcher_icons:main
flutter_icons:
android: "launcher_icon"
ios: true
image_path: "assets/images/app_icon.png"
# For information on the generic Dart part of this file, see the
# following page: https://www.dartlang.org/tools/pub/pubspec
# The following section is specific to Flutter.
flutter:
uses-material-design: true
assets:
- lib/common/config.json
- assets/icons/categories/
- assets/icons/tabs/
- assets/icons/profile/
- assets/icons/payment/
- assets/images/
- assets/images/country/
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.io/assets-and-images/#resolution-aware.
# For details regarding adding assets from package dependencies, see
# https://flutter.io/assets-and-images/#from-packages
# To add custom fonts to your application, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
fonts:
- family: Raleway
fonts:
- asset: assets/fonts/Raleway-Regular.ttf
- asset: assets/fonts/Raleway-Medium.ttf
- asset: assets/fonts/Raleway-Bold.ttf
- asset: assets/fonts/Raleway-Light.ttf
- asset: assets/fonts/Raleway-Thin.ttf
- family: Roboto
fonts:
- asset: assets/fonts/Roboto-Regular.ttf
- asset: assets/fonts/Roboto-Medium.ttf
- asset: assets/fonts/Roboto-Bold.ttf
- asset: assets/fonts/Roboto-Light.ttf
- asset: assets/fonts/Roboto-Thin.ttf
#
# For details regarding fonts from package dependencies,
# see https://flutter.io/custom-fonts/#from-packages
I have this problem how can i solve it?
I'd suggest looking here:
https://dart.dev/tools/pub/dependencies#dependency-overrides
You can override the version number of all dependencies, but be careful as later versions might contain breaking changes that your dependencies might not work with.
In your pubspec.yaml file, add this:
dependency_overrides:
rate_my_app: ^0.6.0+3
I have solved this. You need to update the rate_my_app to 0.6.0+3 and shared_preferences to 0.5.7+3 and then hit packages get.

error message after using notifier 1.0.2 plugin in flutter

I was looking for an alternative for Broadcast receiver in flutter then I got a plugin notifier 1.0.2 after adding to my pubspec.yaml getting an error message like
Because every version of notifier depends on synchronized ^1.5.3+2 and sqflite 1.2.0 depends on synchronized >=2.0.2 <4.0.0, notifier is incompatible with sqflite 1.2.0.
So, because Bluis depends on both sqflite 1.2.0 and notifier 1.0.2, version solving failed.
pub get failed (1; So, because Bluis depends on both sqflite 1.2.0 and notifier 1.0.2, version solving failed.)
Process finished with exit code 1
here is my pubspec.yaml
name: Bluis
description: A new Flutter project.
# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.0+1
environment:
sdk: ">=2.2.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2
rxdart: ^0.22.3
http: ^0.12.0+1
toast: ^0.1.5
sqflite: 1.2.0
intl: ^0.16.0
geolocator: ^5.1.4+2
flutter_compass: ^0.3.4
url_launcher: ^5.2.5
permission_handler: ^4.0.0
camera: ^0.5.2+1
video_player: ^0.10.0
path_provider: ^1.1.0
path: ^1.6.2
e2e: ^0.2.0
esys_flutter_share: ^1.0.2
shared_preferences: ^0.5.4+5
connectivity: ^0.4.5+3
uuid: ^2.0.4
logger: ^0.6.0
event_bus: ^1.1.0
location: ^2.3.4
dio: ^3.0.8
recase: ^3.0.0
flutter_map:
git:
url: git://github.com/okaxaki/flutter_map.git
ref: fix/support-flutter-1.10
dev_dependencies:
flutter_test:
sdk: flutter
notifier: 1.0.2
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
# The following section is specific to Flutter.
flutter:
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true
# To add assets to your application, add an assets section, like this:
assets:
- assets/images/
- assets/locale/localization_en.json
- assets/locale/localization_hi.json
- assets/locale/localization_or.json
I solved my purpose by using event bus
Create an Event Bus
EventBus eventBus = EventBus();
Define Events (Create a class with event name with constructor)
class UserLoggedInEvent {
User user;
UserLoggedInEvent(this.user);
}
Register Listeners (Listen to your events)
eventBus.on<UserLoggedInEvent>().listen((event) {
// All events are of type UserLoggedInEvent (or subtypes of it).
print(event.user);
});
Fire your event
User myUser = User('Mickey');
eventBus.fire(UserLoggedInEvent(myUser));
cancel your all events
eventBus.cancel();