flutter location package version conflict with google_map_location_picker - flutter

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

Related

No file or variants found for asset: packages/sn_progress_dialog/completed.png

I was using sn_progress_dialog when I ran into the error that the asset for this dependency is not found..
However, the official documentation does not mention anything about setting assets for this dependency.
I tried the guidelines to get the dependency and it was working fine. when I reopened the project and it stopped throwing this error.
**I have tried:
flutter pub get and
flutter pub add sn_progress_dialog commands**
My pubspec.yaml file is
name: multi_store_app
description: By RRB Productions
# The following line prevents the package from being accidentally published to
# pub.dev using `flutter 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 is used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version: 1.0.0+1
environment:
sdk: '>=2.19.0-201.0.dev <3.0.0'
# Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions
# consider running `flutter pub upgrade --major-versions`. Alternatively,
# dependencies can be manually updated by changing the version numbers below to
# the latest version available on pub.dev. To see which dependencies have newer
# versions available, run `flutter pub outdated`.
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
animated_text_kit: ^4.2.2
image_picker: ^0.8.6
firebase_auth: ^3.11.2
cloud_firestore: ^3.5.1
firebase_storage: ^10.3.11
firebase_core: ^1.24.0
firebase_app_check: ^0.0.9+1
uuid: ^3.0.6
flutter_staggered_grid_view: ^0.6.2
staggered_grid_view_flutter: ^0.0.4
firebase_core_platform_interface: 4.5.1
flutter_swiper_null_safety: ^1.0.2
flutter_launcher_icons: ^0.10.0
font_awesome_flutter: ^10.2.1
provider: ^6.0.4
awesome_snackbar_content: ^0.0.9
badges: ^2.0.3
sn_progress_dialog: ^1.0.8
dev_dependencies:
flutter_test:
sdk: flutter
# The "flutter_lints" package below contains a set of recommended lints to
# encourage good coding practices. The lint set provided by the package is
# activated in the `analysis_options.yaml` file located at the root of your
# package. See that file for information about deactivating specific lint
# rules and activating additional ones.
flutter_lints: ^2.0.0
flutter_icons:
image_path: "assets/images/icon.png"
# image_path_android: "assets/images/android/icon.png"
# image_path_ios: "aseets/images/ios/icon.png"
android: true
ios: true
# 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 packages.
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/accessories/
- images/bags/
- images/try/
- images/beauty/
- images/electronics/
- images/homegarden/
- images/inapp/
- images/kids/
- images/men/
- images/shoes/
- images/women/
# 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: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
#
# For details regarding fonts from package dependencies,
# see https://flutter.dev/custom-fonts/#from-packages
fonts:
- family: Acme
fonts:
- asset: fonts/Acme-Regular.ttf
- family: AKayaTelivigala
fonts:
- asset: fonts/AkayaTelivigala-Regular.ttf
My code for the dependency is here
Add completed: Completed() inside progress.show().
Also
// Completed values can be customized
// Completed(completedMsg: "Downloading Done !", completedImage: AssetImage("assets/completed.png"), closedDelay: 2500,)
i think the problem is not in your code it is in the package itself.
to solve this just add this line :
// packages/sn_progress_dialog/assets/completed.png
Completed(completedImage : AssetImage("packages/sn_progress_dialog/assets/completed.png")
I hope it helps :)

flutter pubspec.yaml file unknown errors?

so I executed a flutter clean command for my flutter project and then the flutter pub get command but now my flutter project is showing multiple errors in the pubspec.yaml file the code is running but there are unknown errors that are shown. where now even if i create a new flutter project it shows error so i reinstalled the flutter and it still shows the same for pubspec.yaml file only.
please help me out..............
refer the image for error:
name: worksaga
description: A new Flutter project.
# The following line prevents the package from being accidentally published to
# pub.dev using `flutter 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.16.1 <3.0.0"
# Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions
# consider running `flutter pub upgrade --major-versions`. Alternatively,
# dependencies can be manually updated by changing the version numbers below to
# the latest version available on pub.dev. To see which dependencies have newer
# versions available, run `flutter pub outdated`.
dependencies:
flutter:
sdk: flutter
flutter_signin_button: ^2.0.0
multi_image_picker2: ^5.0.2
http: ^0.13.4
loader_overlay: ^2.0.5
shared_preferences: ^2.0.12
dio: ^4.0.4
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
path_provider: ^2.0.8
intl: ^0.17.0
flutter_date_picker_timeline: ^0.3.3
carousel_slider: ^4.0.0
cached_network_image: ^3.2.0
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.2
flutter_svg: ^1.0.3
dev_dependencies:
flutter_test:
sdk: flutter
google_fonts: ^2.3.1
# The "flutter_lints" package below contains a set of recommended lints to
# encourage good coding practices. The lint set provided by the package is
# activated in the `analysis_options.yaml` file located at the root of your
# package. See that file for information about deactivating specific lint
# rules and activating additional ones.
flutter_lints: ^1.0.0
# 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/icons/
# - images/a_dot_ham.jpeg
# 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: NanumMyeongjo
fonts:
- asset: assets/fonts/NanumMyeongjo-ExtraBold.ttf
# - asset: assets/fonts/NanumMyeongjo-Bold.ttf
# weight: 500
# - asset: assets/fonts/NanumMyeongjo-ExtraBold.ttf
# weight: 700
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
#
# For details regarding fonts from package dependencies,
# see https://flutter.dev/custom-fonts/#from-packages
It seems that you've added a tab/space before the name property (first line) in your pubspec.yaml. Indentation is very important in YAML files since it indicates and separates flow blocks.

Flutter mobx mobx_codegen generates null safety code for computed getters

Using mobx and mobx_codegen for Flutter.
My code is NOT null safe (sdk: ">=2.7.0 <3.0.0").
When mobx_codegen generates code for #computed getters, it uses null safety, which won't compile...
Sample class counter (look at #computed):
import 'package:mobx/mobx.dart';
// Include generated file
part 'counter.g.dart';
// This is the class used by rest of your codebase
class Counter = _Counter with _$Counter;
// The store-class
abstract class _Counter with Store {
#observable
int value = 0;
#computed
int get test => 0;
#action
void increment() {
value++;
}
}
Relevant generated code (counter.g.dart):
Computed<int>? _$testComputed;
Shows this error:
This requires the 'non-nullable' language feature to be enabled.
Try updating your pubspec.yaml to set the minimum SDK constraint to 2.12.0 or higher, and running 'pub get'.
I'm new to mobx, am I doing something wrong?
How´s it going?
I am with the same issue in my project. I installed the new flutter version and after that my project stopped to compile. I changed my dependences of mobx, flutter_mobx, mobx_codegen and build_runner and them worked.
My first dependences:
mobx: ^1.2.1+4
flutter_mobx: ^1.1.0+2
build_runner: ^1.11.5
mobx_codegen: ^1.1.2
My last dependences:
mobx: ^2.0.6+1
flutter_mobx: ^2.0.4
build_runner: ^2.1.7
mobx_codegen: ^2.0.5+2
From there, It has started my issue of "#computed" while I run the build_runner.
I changed the Dart SDK of my project and It stopped to show error of "#computed". But broke all source code because I developed my code with "non- null-safety".
So, looking for replies. I figured out the root cause is the specifically the mobx_codegen newer dependency that uses null safety and doesn´t have a tratament to valid our Dart SDK.
In my opnion, It should´ve validated while running of build_runner.
So, Someone knows how could I resolve that issue?
I have a commercial solution of app, and I´ve planned to release until 3 months.
my pubspec.yaml is so:
name: XPTO
description: A new Flutter project.
# The following line prevents the package from being accidentally published to
# pub.dev using `flutter 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 specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions
# consider running `flutter pub upgrade --major-versions`. Alternatively,
# dependencies can be manually updated by changing the version numbers below to
# the latest version available on pub.dev. To see which dependencies have newer
# versions available, run `flutter pub outdated`.
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
mobx: ^2.0.6+1
flutter_mobx: ^2.0.4
get_it: ^7.2.0
flutter_search_bar: ^3.0.0-dev.1
carousel_slider: ^4.0.0
intl: ^0.17.0
image_picker: ^0.8.4+5
image_cropper: ^1.4.1
parse_server_sdk_flutter: ^3.1.0
cpf_cnpj_validator: ^2.0.0
brasil_fields: ^1.3.0
mask_text_input_formatter: ^2.1.0
badges: ^2.0.2
flutter_rating_bar: ^4.0.0
expandable: ^5.0.1
flutter_easyloading: ^3.0.3
internet_connection_checker: ^0.0.1+3
cached_network_image: ^3.2.0
flutter_keyboard_visibility: ^5.1.1
json_annotation: ^4.4.0
dev_dependencies:
flutter_test:
sdk: flutter
build_runner: ^2.1.7
mobx_codegen: ^2.0.5+2
graphs: ^2.1.0
json_serializable: ^6.1.4
dependency_overrides:
plugin_platform_interface: ^2.0.0
build_resolvers: ^2.0.6
web_socket_channel: ^2.0.0
analyzer: ^3.2.0
# The "flutter_lints" package below contains a set of recommended lints to
# encourage good coding practices. The lint set provided by the package is
# activated in the `analysis_options.yaml` file located at the root of your
# package. See that file for information about deactivating specific lint
# rules and activating additional ones.
flutter_lints: ^1.0.0
# 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/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg
assets:
- images/logo.jpeg
- images/empty.jpg
# 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: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
#
# For details regarding fonts from package dependencies,
# see https://flutter.dev/custom-fonts/#from-packages
Since you're using a version of MobX that has null-safety, you can either:
migrate your code to null-safety (recommended).
downgrade your mobx, mobx_codegen and build_runner packages to a version that doesn't have null-safety.
To migrate your code, you can follow this Migration Guide.
If you opt to downgrade, be aware that you might run into version conflicts and there's a chance you have to downgrade your Flutter SDK too.

flutter_whatsapp depends on both integration_test ^1.0.2+3 and flutter_driver any from sdk, version solving failed

Because every version of flutter_driver from sdk depends on vm_service 7.3.0 and integration_test 1.0.2+3 depends on vm_service >=4.2.0 <7.0.0, flutter_driver from sdk is incompatible with integration_test 1.0.2+3.
And because no versions of integration_test match >1.0.2+3 <2.0.0, flutter_driver from sdk is incompatible with integration_test ^1.0.2+3.
So, because flutter_whatsapp depends on both integration_test ^1.0.2+3 and flutter_driver any from sdk, version solving failed.
Running "flutter pub get" in flutter_whatsapp...
pub get failed (1; So, because flutter_whatsapp depends on both integration_test ^1.0.2+3 and flutter_driver any from sdk, version solving
failed.)
Am getting this kinda error
Thanks in advance...
name: flutter_whatsapp
description: A new Flutter project.
# 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.3
ext_storage: ^1.0.3
intl: ^0.17.0
http: ^0.13.4
contacts_service: ^0.6.3
cached_network_image: ^3.1.0
camera: ^0.9.4+3
# video_player: ^0.10.0+5
path_provider: ^2.0.6
fluro: ^2.0.3
sliding_up_panel: ^2.0.0+1
flutter_app_badger: ^1.3.0
url_launcher: ^6.0.12
shared_preferences: ^2.0.8
android_intent: ^0.3.7+6
permission_handler: ^8.2.5
integration_test: ^1.0.2+3
uuid: ^3.0.5
# fast_qr_reader_view: ^0.1.5
# fast_qr_reader_view:
# git:
# url: git://github.com/facundomedica/fast_qr_reader_view.git
dev_dependencies:
flutter_driver:
sdk: flutter
flutter_test:
sdk: flutter
version: any
# test: ^1.5.0
# 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/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg
# 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: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
#
# For details regarding fonts from package dependencies,
# see https://flutter.dev/custom-fonts/#from-packages

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