Upgraded to Flutter 3.0 from 2.8.1, getting: Warning: Operand of null-aware operation '?.' has type 'PaintingBinding' which excludes null error - flutter

Upgraded to Flutter 3.0 from 2.8.1, getting: Warning: Operand of null-aware operation '?.' has type 'PaintingBinding' which excludes null error
It's on binding.dart - a file I don't touch at all.
() => PaintingBinding.instance?.imageCache?.evict(key),
^
Any chance you guys know how I can fix it?
Don't know if related, but also seeing this a lot:
Class 'kotlin.Unit' was compiled with an incompatible version
Used the guide here to migrate: https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects
This is my pubspec:
environment:
sdk: '>=2.12.0 <3.0.0'
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
google_maps_flutter: ^2.0.6
rxdart:
shimmer:
cupertino_icons: ^1.0.3
dependencies:
flutter_svg: ^1.0.0
http: ^0.13.3
flutter_spinkit: ^5.0.0
url_launcher: ^6.0.9
html: ^0.15.0
cached_network_image: ^3.1.0
collection: ^1.15.0
share_plus: ^3.0.4
flutter_native_splash: ^1.3.2
dev_dependencies:
flutter_test:
sdk: flutter
flutter_launcher_icons: ^0.9.2
flutter_icons:
android: true
ios: true
image_path: "assets/app/launch/ic_launcher.png"
adaptive_icon_padding: 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.
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

So, something which helped me:
remove the next folder /Users/your-user/.pub-cache/hosted/pub.dartlang.org
hit flutter pub upgrade
and then try to run your project 🎉

For the ones that have the same issue: changing my Kotlin version (manually), did the trick.
Now, in build.gradle:
buildscript {
ext.kotlin_version = '1.6.21'
repositories {
google()
jcenter()
}
I have this instead of version 1.3.40

remove "?" at () => PaintingBinding.instance?.imageCache?.evict(key),

Related

how to resolve this problem in flutter.bat i don't understand anything

Error: No named parameter with the name 'nullOk'.
../…/src/extended_image.dart:786
_invertColors = MediaQuery.of(context, nullOk: true)?.invertColors ??
^^^^^^
: Context: Found this candidate, but the arguments don't match.
../…/widgets/media_query.dart:818
static MediaQueryData of(BuildContext context) {
^^
2
FAILURE: Build failed with an exception.
Where:
Script 'C:\src\flutter\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1035
What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
Process 'command 'C:\src\flutter\flutter\bin\flutter.bat'' finished with non-zero exit value 1
Try:
Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 59s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
name: pubx
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.12.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
intl: ^0.17.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
auto_size_text: ^3.0.0
pixel_perfect: ^1.1.1
get: 4.5.1
extended_image: ^2.0.0
like_button: ^2.0.5
fluttericon: ^2.0.0
google_nav_bar: ^5.0.6
flutter_switch: ^0.0.2
story_view: ^0.12.8
share: ^2.0.4
flutter_share: ^2.0.0
flutter_native_splash: ^0.3.2
google_fonts: ^1.1.2
get_storage: ^1.2.1
flutter_secure_storage: ^4.2.1
image_cropper: ^1.5.1
cached_network_image: ^2.5.1
connectivity_plus: ^0.8.1
sqflite: ^2.0.2
path_provider: ^1.6.28
path: ^1.8.0
equatable: ^2.0.5
#flutter_bloc: ^7.1.0
intl_phone_number_input: ^0.1.2
vibration: ^1.7.6
sound_mode: ^2.0.2
flutter_facebook_auth: ^2.0.2+1
#flutter_facebook_auth: ^3.0.0-nullsafety.0
google_sign_in: ^5.1.0
http: ^0.12.2
#firebase_auth: ^0.16.1
#firebase_core: ^0.4.4
dev_dependencies:
flutter_test:
sdk: flutter
dio: ^3.0.10
jwt_decode:
flutter_spinkit: any
image_picker: ^0.6.7+6
image_gallery_saver: any
# image_picker: any
provider: ^5.0.0
permission_handler: any
shared_preferences: any
shimmer: ^2.0.0
# flutter_local_notifications: any
font_awesome_flutter: ^9.1.0
#keyboard_actions: any
# flutter_3d_choice_chip: ^0.1.4
# Shared_preferences: ^0.5.7+1
# firebase_messagering: ^6.0.13
flutter_local_notifications: ^1.4.3
# cached_network_image: ^2.1.0+1
# image_cropper: ^1.2.1
# photo_view: ^0.9.2
# url_launcher: ^5.4.10
# video_thumbnail: ^0.5.0
keyboard_actions: any
# flutter_3d_choice_chip: ^0.1.4
# Shared_preferences: ^0.5.7+1
# firebase_messagering: ^6.0.13
#flutter_local_notifications: ^1.4.3
# cached_network_image: ^2.1.0+1
# image_cropper: ^1.2.1
# photo_view: ^0.9.2
# url_launcher: ^5.4.10
# video_thumbnail: ^0.5.0
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
flutter_native_splash:
color: "#ffffff"
color_dark: "#272727"
image: 'assets/images/logo-PubX-Mobile.png'
image_dark: 'assets/images/logo-PubX-Mobile.png'
android_12:
image: 'assets/images/logo-PubX-Mobile.png'
icon_background_color: "#ffffff"
image_dark: 'assets/images/logo-PubX-Mobile.png'
icon_background_color_dark: "#272727"
# 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.
generate: true
uses-material-design: true
# To add assets to your application, add an assets section, like this:
assets:
- assets/images/
- assets/images/photos/
# 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

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

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

Could not load source 'dart:_http/http_impl.dart': <source not available>

My flutter app is crashing and showing this error "Could not load source 'dart:_http/http_impl.dart': ."
My pub file
name: name_here 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.
# Read more about versioning at semver.org. version: 1.0.0+1
environment: sdk: ">=2.0.0-dev.68.0 <3.0.0"
dependencies: flutter:
sdk: flutter
banner: ^0.1.3 cloud_firestore: ^0.8.2
# The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^0.1.2 sqflite: any flutter_rating: ^0.0.2 flutter_firebase_ui: ^0.0.12
dev_dependencies: flutter_test:
sdk: flutter
# 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:
# 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.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: 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.io/custom-fonts/#from-packages
Add http to dependencies like
dependencies:
http: ^0.12.0
and then run flutter packages get and import it like
import 'package:http/http.dart';