A question regarding LATLNG package & LatLng type in Flutter - flutter

LATLNG giving The argument type 'LatLng' can't be assigned to the parameter type 'LatLng'
The argument type 'LatLng (where LatLng is defined in E:\flutter.pub-cache\hosted\pub.dartlang.org\latlong2-0.8.0\lib\latlong\LatLng.dart)' can't be assigned to the parameter type 'LatLng (where LatLng is defined in E:\flutter.pub-cache\hosted\pub.dartlang.org\latlong-0.6.1\lib\latlong\LatLng.dart)'
Below are the dependencies with the commented out ones not in use.
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
font_awesome_flutter: ^8.11.0
flutter:
sdk: flutter
firebase_core: ^0.7.0
firebase_analytics: ^7.0.1
firebase_auth: ^0.20.0+1
cloud_firestore: ^0.16.0
firebase_storage: ^7.0.0
readmore: ^2.0.0
google_fonts: ^1.1.1
google_sign_in: "^4.5.1"
flutter_login_facebook: ^0.4.2+3
# mapbox_gl: ^0.10.0
location: ^4.3.0
provider: ^4.3.3
image_picker: ^0.6.7+3
image_cropper: ^1.4.0
shared_preferences: ^0.5.3+4
# geolocator: 6.2.1
intl: ^0.16.1
http: ^0.12.0+2
geocoding: ^2.0.0
# geocoder: ^0.2.1
flutter_map: ^0.12.0
# latlong: ^0.8.0
# geoflutterfire: ^2.2.2
dev_dependencies:
flutter_test:
sdk: flutter
flutter_launcher_icons: ^0.8.1

As a maintainer of flutter_map, this is what you should do:
Depend on the latest version of 'latlong2' as usual
Import it into all necessary files
'flutter_map' used to export this library automatically for you, but does not any more. Besides, it is now recommended by Dart to depend on all used packages, whether or not they are exported by others.
This has been added to the documentation website as of v1.1.1.

Related

Because every version of flutter_test from sdk depends on path 1.8.1

How ı fix this?
Because every version of flutter_test from sdk depends on path 1.8.1 and fleets depends on path ^1.8.2, flutter_test from sdk is forbidden.
So, because fleets depends on flutter_test from sdk, version solving failed.
pub get failed (1; So, because fleets depends on flutter_test from sdk, version solving failed.)
Process finished with exit code 1
dependencies:
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
video_player: ^2.4.5
image_cropper: ^2.0.3
image_picker: ^0.8.5+3
shared_preferences: ^2.0.15
cached_network_image: ^3.2.1
dio: ^4.0.6
carousel_slider: ^4.1.1
async: ^2.9.0
toast: ^0.3.0
path: ^1.8.2
custom_refresh_indicator: ^1.2.1
flutter_screenutil: ^5.5.3+2
flutter_slidable: ^1.3.1
timeago: ^3.2.2
inview_notifier_list: ^3.0.0
path_provider: ^2.0.11
permission_handler: ^10.0.0
google_fonts: ^3.0.1
fluttertoast: ^8.0.9
photofilters: ^3.0.1
flutter_spinkit: ^5.1.0
cloud_firestore: ^3.2.1
firebase_auth: ^3.4.1
firebase_database: ^9.0.18
firebase_storage: ^10.3.1
firebase_messaging: ^11.4.4
photo_view: ^0.14.0
google_sign_in: ^5.4.0
flutter_image_compress: ^1.1.0
linkable: ^3.0.1
flutter_staggered_grid_view: ^0.6.2
webview_flutter: ^3.0.4
visibility_detector: ^0.3.3
video_thumbnail: ^0.5.0
dynamic_themes: ^1.1.0
nb_utils: ^4.6.12
flutter_svg: ^1.1.1+1
adaptive_theme: ^3.1.0
material_design_icons_flutter: ^5.0.6996
file_picker: ^4.6.1
cupertino_icons: ^1.0.5
intl: ^0.17.0
carousel_pro: ^1.0.0
#flutter_absolute_path: ^1.0.6
url: ^2.0.0
image_gallery_saver: ^1.7.1
screenshot: ^1.2.3
dashed_circle: ^0.0.2
convex_bottom_bar: ^3.0.0
another_flushbar: ^1.10.29
video_compress: ^3.1.1
iconly: ^1.0.1
line_awesome_flutter: ^2.0.0
ionicons: ^0.1.2
share: ^2.0.4
flutter_reaction_button: ^2.0.1+1
filesize: ^2.0.1
flutter_absolute_path:
git:
url: https://github.com/canewsin/flutter_absolute_path.git
Try changing the version of path to any in pubspec.yaml
path: any
This should fetch the correct version of this package.

Because your app depends on flutter_link_preview ^1.0.3 which depends on http ^0.12.1, http ^0.12.1 is required

I have this problem when pub get my app
because flutter_twitter depends on flutter_link_preview ^1.0.3 which depends on http ^0.12.1, http ^0.12.1 is required"
I try to change http ^0.13.0 to http ^0.12.1 but have this problem
Because google_fonts 2.1.0 depends on http ^0.13.0 and no versions of google_fonts match >2.1.0 <3.0.0, google_fonts ^2.1.0 requires http ^0.13.0
this is pubspec:-
version: 1.0.6+11
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.2
dartz: ^0.9.2
get_it: ^5.0.6
freezed_annotation: ^0.12.0
flutter_link_preview: ^1.0.3
cached_network_image: ^3.1.0
provider: ^4.3.2+2
firebase_auth: ^2.0.0
firebase_database:
firebase_analytics:
cloud_firestore:
firebase_storage:
equatable: ^2.0.0
http: ^0.12.1
image_picker: ^0.8.2
package_info: ^0.4.1
shared_preferences: ^0.5.1+2
firebase_messaging: ^10.0.3
google_sign_in: "^4.5.1"
intl: ^0.17.0
url_launcher:
share: ^2.0.4
google_fonts: ^2.1.0
firebase_remote_config: ^0.10.0+2
firebase_dynamic_links: ^2.0.6
qr_code_scanner: ^0.3.5
qr_flutter: ^3.2.0
rxdart: ^0.27.1
flutter_link_preview: ^1.0.3 change into
flutter_link_preview:
Somtimes it will work.
Update your library like this-
flutter_link_preview:
http:
if you still face any issue, you can remove all version from every library/packages. It will work in every case.
This was shared by AlphaMerc(creator of Fwitter, Twitter clone) :
"Not really a good practice, but I managed to overcome the same situation by overriding the http dependency.
Add inside the pubspec.yaml file the following
dependency_overrides:
http: ^0.13.3"
I tried the above and it works.

Flutter Pubnub version solving failed

got this exception when I add pubnub: ^1.4.4 into pubspec.yaml
Because pubnub >=1.0.2 <3.2.0 depends on dio ^3.0.0 and talad_flutter
depends on dio ^4.0.0, pubnub >=1.0.2 <3.2.0 is forbidden. So, because
talad_flutter depends on pubnub ^1.4.4, version solving failed.
I've tried to reduce version of each library but still not luck.
here is my full pubspec.yaml
name: mytest_flutter
description: A new Flutter project.
publish_to: "none"
version: 1.0.0+1
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.2
provider: ^5.0.0
http: ^0.13.1
flutter_staggered_grid_view: ^0.4.0
carousel_slider: ^3.0.0
countdown_flutter: ^0.1.2
intl: ^0.17.0
percent_indicator: ^3.0.1
custom_refresh_indicator: ^0.9.0
material_design_icons_flutter: ^4.0.5955
flutter_spinkit: ^5.0.0
image_picker: ^0.7.4
firebase_ml_vision: ^0.11.0+2
firebase_core: ^1.0.3
cached_network_image: ^3.0.0
font_awesome_flutter: ^9.0.0
cloud_firestore: ^1.0.4
url_launcher: ^6.0.3
rflutter_alert: ^2.0.2
shared_preferences: ^2.0.5
smooth_star_rating: ^1.1.1
share: ^2.0.1
flutter_html: ^1.3.0
dio: ^4.0.0
flutter_tags: ^0.4.9+1
package_info: ^2.0.0
smart_select: ^4.3.2
google_maps_flutter: ^2.0.3
geolocator: ^7.0.3
timeago: ^3.0.2
firebase_storage: ^8.0.5
firebase_messaging: ^9.1.3
fl_chart: ^0.36.0
webview_flutter: ^1.0.7
pubnub: ^1.4.4
dev_dependencies:
flutter_test:
sdk: flutter
flutter_launcher_icons: ^0.9.0
flutter:
uses-material-design: true
assets:
- assets/images/
flutter_icons:
android: true
image_path_android: "assets/images/logo.png"
ios: true
image_path_ios: "assets/images/logo.png"
According to PubNub Engineering
This is a very outdated version of the pubnub package. Currently we are on 3.x and about to release 4.x
In general, you can always solve this kind of issue with Dart using dependency overrides
if you update last version. Maybe error version. You can use
provider:
http:
flutter_staggered_grid_view:
carousel_slider:
countdown_flutter:
intl:
percent_indicator:
custom_refresh_indicator:
material_design_icons_flutter:
flutter_spinkit:
image_picker:
firebase_ml_vision:
firebase_core:
cached_network_image:
font_awesome_flutter:
cloud_firestore:
url_launcher:
rflutter_alert:
shared_preferences:
smooth_star_rating:
share:
flutter_html:
dio:
flutter_tags:
package_info:
smart_select:
google_maps_flutter:
geolocator:
timeago:
firebase_storage:
firebase_messaging:
fl_chart:
webview_flutter:
pubnub:
and flutter get pub. It works for you.

No named parameter with the name 'resizeToAvoidBottomPadding'

I try to run my app on VSCode but I get this error:
I've tried to update flutter version/pubspec packages version/flutter clean/delete the build folder and run again. But nothing seems to work.
this is my pubspec.yaml
add_2_calendar: ^2.0.1
add_2_calendar: ^2.0.1
camera: ^0.7.0+2
charts_flutter: ^0.10.0
cupertino_icons: ^1.0.2
device_calendar: ^3.1.0
dio: ^3.0.10
dio_http_cache: ^0.2.9
expandable: ^5.0.1
firebase_core: ^0.7.0
firebase_database: ^6.0.0
firebase_messaging: ^8.0.0-dev.15
fl_chart: ^0.35.0
flick_video_player: ^0.1.1
flutter_email_sender: ^5.0.0
flutter_form_builder: ^6.0.0-nullsafety.1
flutter_icons: ^1.1.0
flutter_linkify: ^5.0.0
flutter_paginator: ^0.0.6
flutter_svg: ^0.19.3
flutter_widget_from_html: ^0.5.0+3
fluttericon: ^2.0.0
gallery_saver: ^2.0.1
geolocator: ^6.2.1
get_it: ^6.0.0
http: ^0.12.0+2
image_picker: ^0.6.2+3
intl: ^0.17.0
mailer: ^5.0.0
overlay_support: ^1.0.5
path_provider: ^1.6.11
permission_handler: ^5.0.1+1
provider: ^4.0.5
splashscreen: ^1.2.0
timeline_tile: ^2.0.0
url_launcher: ^5.5.0
video_player: ^0.10.12+2
weather_icons: ^2.0.2
webview_flutter: ^1.0.7
flutter --version
flutter doctor
The reason you get this is that you use flutter_widget_from_html, that has no null safe version yet, this package depends on old version of chewie (v0.10.4), that uses deprecated property of Scaffold resizeToAvoidBottomPadding.
What you can do is to downgrade your Flutter SDK to pre null-safety version, or rewrite your code without using flutter_widget_from_html package in favor for example chewie, that already has null safety widget.
You can check more info about migrating to null safety here.
If you are willing to downgrade your SDK to pre-null safety you can use this answer.

firebase messaging and flutter sdk driver version solving failed

Details about issue : Because every version of flutter_driver from sdk depends on process 4.0.0-nullsafety.2 which depends on platform ^3.0.0-nullsafety.1, every version of flutter_driver from sdk requires platform ^3.0.0-nullsafety.1.
And because firebase_messaging >=0.2.0 <7.0.2 depends on platform ^2.0.0, flutter_driver from sdk is incompatible with firebase_messaging >=0.2.0 <7.0.2.
So, because receiptree depends on both firebase_messaging ^6.0.13 and flutter_driver any from sdk, version solving failed.
Running "flutter pub get" in working...
pub get failed (1; So, because xxxx depends on both firebase_messaging ^6.0.13 and flutter_driver any from sdk, version solving failed.)
Please help me to format below code
version: 0.9.9-beta+9
environment:
sdk: ">=2.7.0 <3.0.0"
depedencies:
Auth
firebase_auth: ^0.15.5+3
google_sign_in: ^4.4.0
flutter_facebook_login: ^3.0.0
apple_sign_in: ^0.1.0
Notification
firebase_messaging: ^6.0.13
firebase_dynamic_links: ^0.5.0+11
fluttertoast: ^4.0.1
Core
provider: ^4.0.4
auto_route: ^0.4.2
flutter_mobx: ^1.1.0
mobx: ^1.1.1
mobx_codegen: ^1.0.3
firebase_ml_vision: ^0.9.3+8
Dependency injection
inject:
git:
url: https://github.com/google/inject.dart.git
path: package/inject
ref: 7c3cbf6
Storage
shared_preferences: ^0.5.6+3
firebase_storage: ^3.1.5
cloud_firestore: ^0.13.4+2
UI
photo_view: ^0.9.2
flutter_page_indicator: 0.0.3
datetime_picker_formfield: ^1.0.0
image_picker: ^0.6.4
flutter_datetime_picker: ^1.4.0
image_cropper: ^1.2.1
flutter_typeahead: ^1.8.0
flutter_masked_text: ^0.8.0
video_player: null
Utility
flutter_svg: ^0.18.1
flutter_image_compress: ^0.6.5+1
firebase_analytics: ^5.0.11
firebase_crashlytics: ^0.1.3+3
package_info: ^0.4.0+16
http: ^0.12.2
dartz: ^0.9.1
faker: ^1.2.1
intl: ^0.16.1
printing: ^3.6.0
image_gallery_saver: ^1.5.0
dio: ^3.0.10
flutter_email_sender: ^3.0.1
Unknown
path_provider: ^1.6.5
flutter:
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.3
random_string: ^2.1.0
permission_handler: ^5.0.1+1
share: ^0.6.5+2
url_launcher: ^5.7.1
dev_dependencies:
flutter_test:
sdk: flutter
mockito: ^4.1.1
flutter_driver:
sdk: flutter
test: any
timeago: ^2.0.26
flutter_launcher_icons: ^0.8.0
auto_route_generator: ^0.4.0
build_runner: null
inject_generator:
git:
url: https://github.com/google/inject.dart.git
path: package/inject_generator
ref: 7c3cbf6
I faced the same problem. The problem is coming from firebase messaging.
Currently, you have:
firebase_messaging: ^6.0.13
which limits firebase messaging to a version 6.
Replace it with
firebase_messaging: ^7.0.0
And it should solve your issue.