Error when running flutter pub get command - android

I would like to ask for help, I've searched all the answers here in the community and I can't solve my error.
I had to update a personal project to Android sdk 32, but when I try to run the Flutter pub get command I'm having an SDK version error, I'm leaving the pub spec and the error image below.
Error Picture Here
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
version: 1.0.0+1
environment:
sdk: ">=2.17.0 <3.0.0"
dependencies:
dio: ^4.0.0
rxdart: ^0.27.1
bloc_pattern: ^3.0.0
flutter_launcher_icons: ^0.10.0
flutter_translate: ^4.0.3
flutter_localizations:
sdk: flutter
equatable: any
json_annotation: any
freezed_annotation: any
webview_flutter: ^3.0.4
flutter_cache_manager: ^3.3.0
upgrader: ^4.6.1
video_thumbnail: ^0.5.3
## Animation rive
#rive: ^0.7.22
# Native
package_info_plus: ^1.0.3
geolocator: ^9.0.2
path_provider: ^2.0.2
file_picker: ^4.1.6
open_file: ^3.2.1
url_launcher: ^6.0.8
shared_preferences: ^2.0.6
qr_code_scanner: ^1.0.1
cross_file: ^0.3.2
camera: ^0.10.0+3
# Layout
introduction_screen: ^3.0.2
font_awesome_flutter: ^10.1.0
select_form_field: "^2.1.0"
#mask_text_input_formatter: ^2.0.0
another_flushbar: ^1.10.24
flutter_switch: ^0.3.2
flutter_app_badger: ^1.2.0
image_picker: ^0.8.5+3
flutter_neat_and_clean_calendar: ^0.3.8+22
date_utils: ^0.2.0
date_format: ^2.0.2
#flutter_form_builder: ^6.0.1
date_time_picker: ^2.1.0
flutter_rating_bar: ^4.0.0
signature: ^5.2.1
flutter_simple_treeview: ^3.0.0-nullsafety.1
widget_to_image: ^2.0.0
flutter_email_sender: ^5.0.2
in_app_review: ^2.0.2
flutter_typeahead: ^4.1.1
brasil_fields: ^1.5.0
grouped_list: ^5.1.2
mat_month_picker_dialog: ^1.0.1
# Videos Acesso Cameras
video_viewer: ^1.2.6
fijkplayer: ^0.10.1
# Conteudo html
flutter_html: ^3.0.0-alpha.5
## FIREBASE
firebase_core: ^1.13.1
firebase_messaging: ^13.0.3
flutter_local_notifications: ^11.0.1
## Share Social
share: ^2.0.4
flutter:
sdk: flutter
json_serializable: any
build_runner: any
freezed: any
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
dev_dependencies:
mockito: ^5.0.10
flutter_test:
sdk: flutter
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
flutter_icons:
android: "ic_launcher"
ios: true
image_path: "assets/icon/icon.png"
adaptive_icon_background: "assets/icon/icon.png"
adaptive_icon_foreground: "assets/icon/icon.png"
# 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/img/
- assets/i18n/
- assets/animation/loading.riv
- assets/json/paises.json
# 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```

replace your sdk with
sdk: ">=2.15.1 <3.0.0"

I managed to solve this problem, I uninstalled flutter on the mac and installed it again, I think the mac was cached.

Related

Cann't install the app message on play store in Flutter App

I have recently published an update (version xx(x.x.x)) on Myapp on the play store. I am getting an error message (Can't install Myapp) please check the attached screenshots. when a user tries to update the app, however, the initial install (if the user uninstalls the existing app and installs the app again) is working fine. In my app, I have written a program to inform our users when we have a higher version available on the play store. This feature redirects users to the app store to install updates. It works alright. Before the release of this version, users were able to install the updates.
I have already tried suggested options like clearing the play store's cache and allowing updating apps on all networks, etc.
Looking for your guidance to solve this issue.
My pubspec.yaml
name: xxx
description: A new Flutter application.
# 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.9.0+21
environment:
sdk: '>=2.12.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: ^1.0.4
http: ^0.13.4
#firebase_core_platform_interface: 4.5.2 # note removed ^
firebase_messaging: ^14.1.4 # previously I only had this which was pulling in 4.5.2 which you do not want
firebase_core: ^2.4.0
sqflite: ^2.0.2
path_provider: ^2.0.9
device_info: ^2.0.3
mime_type: ^1.0.0
expandable: ^5.0.1
permission_handler: ^9.2.0
connectivity: ^3.0.6
shared_preferences: ^2.0.13
datetime_picker_formfield: ^2.0.0
intl: ^0.17.0
flutter_speed_dial: ^5.0.0+1
camera: ^0.9.7+1
fluttertoast: ^8.0.8
video_player: ^2.2.10
url_launcher: ^6.1.4
file_picker: ^4.5.1
image_picker: ^0.8.4+11
share_plus: ^4.0.4
quiver: ^3.0.1+1
syncfusion_flutter_pdfviewer: ^19.4.50-beta
sms_autofill: ^2.2.0
flutter_native_image: ^0.0.6
whatsapp_unilink: ^2.0.2
smooth_star_rating_null_safety: ^1.0.4+2
encrypt: ^5.0.1
percent_indicator: 4.0.0
paytm_allinonesdk: ^1.1.5
google_maps_flutter: ^2.1.5
package_info: ^2.0.2
light_compressor: ^1.2.2
firebase_remote_config: ^3.0.7
flutter_html: ^2.2.1
device_apps: ^2.2.0
regexpattern: ^2.0.1
eva_icons_flutter: ^3.1.0
#dio: ^4.0.6
http_client: ^1.5.1
excel: ^2.0.0-null-safety-3
footer: ^0.0.4
#rxdart: ^0.27.5
#hive_flutter: ^1.1.0
cached_network_image: ^3.0.0
#external_path: ^1.0.0
#file_selector: ^0.9.2
flutter_exif_rotation: ^0.5.1
visibility_detector: ^0.3.3
#equatable: ^2.0.3
#flutter_bloc: ^8.0.1
#formz: ^0.4.0
#async: ^2.8.2
#date_time_picker: ^2.1.0
flutter_local_notifications: ^12.0.2
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/logo_new.png
- assets/
# - assets/logo_xtra_trust.png
- assets/XTRANET_CPS_Ver4.0.0_signed.pdf
- assets/subscriber_agreement.pdf
- assets/subscriber_agreement_hindi.pdf
# 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: Poppins
fonts:
- asset: fonts/poppins_regular.ttf
please installed old version of your app
after this please watch the linked video steps and apply those steps. your problem will be solved, but my suggestion is that simultaneously watch steps and apply the steps one by one and click on the update button continuously. that's why your problem is solved and you will get to know where your app is stuck
Link : - https://www.google.com/search?q=Google+Play+Store+showing+Update+button+but+app+cant+update&rlz=1C1JJTC_enIN988IN988&oq=Google+Play+Store+showing+Update+button+but+app+cant+update&aqs=chrome..69i57j69i64.13673j0j7&sourceid=chrome&ie=UTF-8#fpstate=ive&vld=cid:3e3f7763,vid:k7rff10D1F4
I came across the same problem a few days ago.
We have released 2.0 of existing app. So the version number also changes to 2.0(some big num). After that, we face this issue. But all update with 2.0 we can install there was no problem we face.
Check anything suspicious in your version number.

Unhandled Exception: MissingPluginException(No implementation found for method X on channel plugins.flutter.io/Y)

I have migrated my flutter project to null safety by following the steps here.
Ever since then, I am facing this error below every now and then for multiple packages.
Unhandled Exception: MissingPluginException(No implementation found for method getAll on channel plugins.flutter.io/shared_preferences)
The above is of shared_preferences, but a similar error is thrown for path_provider, firebase_analytics.
Here is my pubspec.yaml
name: news_app
description: A news app
# 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.10+22
environment:
sdk: ">=2.1.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
curved_navigation_bar: ^1.0.1
http: ^0.13.4
webview_flutter: ^2.8.0
firebase_core: ^1.10.6
firebase_auth: ^3.3.4
flutter_cache_manager: ^3.3.0
flutter_widget_from_html_core: ^0.8.4
flutter_widget_from_html: ^0.8.0
flutter_html: ^2.1.5
page_view_indicators: ^2.0.0
splashscreen: ^1.3.5
intl: ^0.17.0
jiffy: ^5.0.0
dio: ^4.0.4
dio_http_cache: ^0.3.0
shared_preferences: ^2.0.6
connectivity: ^3.0.6
share: ^2.0.4
sqflite: ^2.0.1
path_provider: ^2.0.2
timeago: ^3.1.0
auto_size_text: ^3.0.0
flutter_tts: ^3.3.2
firebase_messaging: ^11.2.4
firebase_analytics: ^9.0.4
flutter_local_notifications: ^9.1.5
chewie: ^1.2.2
flutter_svg: ^0.22.0
provider: ^5.0.0
webview_flutter_plus: ^0.2.3+1
firebase_admob: ^0.11.2
scroll_app_bar: ^2.0.0
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.4
dev_dependencies:
flutter_test:
sdk: flutter
flutter_launcher_icons: ^0.9.2
flutter_icons:
image_path: "assets/logo.jpg"
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.
flutter:
fonts:
- family: sourcePro
fonts:
- asset: assets/SourceSansPro-Light.ttf
- family: serifPro
fonts:
- asset: assets/SourceSerifPro-Light.otf
- family: metaSerifPro
fonts:
- asset: assets/FFMetaSerifPro-Light.ttf
# 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
assets:
- assets/logo.jpeg
- assets/tbs_logo_transparent.png
- assets/logo.png
- assets/logo.jpg
# 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
Here is the result of flutter doctor
[✓] Flutter (Channel stable, 2.5.3, on Ubuntu 16.04.7 LTS 4.15.0-142-generic, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2020.3)
[✓] VS Code (version 1.63.2)
[✓] Connected device (3 available)
I tried the below measures, which I found from other posts, and github issues.
I tried switching to different flutter channels.
Also tried changing the versions of the mentioned packages.
Tried deleting cache with flutter clean.
I uninstalled the app and reinstalled it, still the same.
Reinstalled all packages.
Restarted Android Studio after invalidating the cache.
None of it worked whatsoever. Before migrating to null safety things were working fine.
I can suggest you another way instead. Instead of migrating existing project to null safety, create new project (with null safety) and copy lib folder from old project. then add the packages (Make sure you have up-to-date versions.) you installed from the old pubspec.yaml file to the new pubspec.yaml file. (as well as assets and fonts, if any). and if the packages you add require additional integrations for iOS and Android platforms, do them. I stay in the old version of lutter, (ie, non-null-safety) projects in this way I am renewing.

Flutter available camera returns null

I'm using the flutter camera plugin to record a video but the code keeps throwing:
The method '[]' was called on null.
Receiver: null
Tried calling: [](0)
when I try to get the first camera (cameras.first or cameras[0]). This is happening even with the examples given in the plugin docs: https://pub.dev/packages/camera/example
Here's my pubspec.yaml:
# #format
name: camera_example
description: A camera example app
# 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:
archive: ^3.1.2
bloc: ^7.0.0
cached_network_image: ^3.1.0
cupertino_icons: ^1.0.3
dio: null
equatable: ^2.0.3
eva_icons_flutter: ^3.0.0
flutter:
sdk: flutter
flutter_bloc: ^7.1.0
flutter_secure_storage: ^4.2.1
flutter_svg: ^0.22.0
font_awesome_flutter: ^8.8.1
http: ^0.13.3
image_picker: ^0.8.2
introduction_screen: ^2.1.0
line_icons: null
logger: null
path_provider: ^2.0.2
provider: ^5.0.0
rxdart: ^0.27.1
shared_preferences: ^2.0.6
video_player: ^2.1.10
camera:
# path: ./
carousel_slider: ^4.0.0
marquee: ^2.2.0
responsive_builder: ^0.4.1
page_indicator: ^0.4.1
path: ^1.8.0
permission_handler:
dev_dependencies:
flutter_launcher_icons: ^0.9.0
flutter_native_splash: ^1.2.0
flutter_native_splash:
color: "#000000"
image: "assets/images/bg.png"
android: true
ios: true
flutter_icons:
android: "launcher_icon"
ios: true
image_path: "assets/images/icon.png"
# 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/videos/
- assets/
# - 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: TikTokIcons
fonts:
- asset: assets/fonts/TikTokIcons.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
I believe I have done everything according to the documentation but I keep on getting the error. I am testing on a real android(android 10) device.
The example code I'm referring to:
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:camera/camera.dart';
List<CameraDescription> cameras;
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
cameras = await availableCameras();
runApp(CameraApp());
}
class CameraApp extends StatefulWidget {
#override
_CameraAppState createState() => _CameraAppState();
}
class _CameraAppState extends State<CameraApp> {
CameraController controller;
#override
void initState() {
super.initState();
controller = CameraController(cameras[0], ResolutionPreset.max);
controller.initialize().then((_) {
if (!mounted) {
return;
}
setState(() {});
});
}
#override
void dispose() {
controller?.dispose();
super.dispose();
}
#override
Widget build(BuildContext context) {
if (!controller.value.isInitialized) {
return Container();
}
return MaterialApp(
home: CameraPreview(controller),
);
}
}
PS: I'm new to flutter

Execution failed for task ':google_sign_in:verifyReleaseResources'. Flutter google sign in

I have created an app with flutter and firebase and i am trying to create the build apk. but i get error when running flutter build apk. i think it is because my google sign in is not setup for release.
Execution failed for task ':google_sign_in:verifyReleaseResources'.
> 1 exception was raised by workers:
com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
E:\Mobile App evelopment\
Fiverr\pet_walker\build\google_sign_in\intermediates\res\merged\
release\values\values.xml:314: error: resource android:attr/fontVariationSettings not found.
I have signed android apk but i have not got sha-1 production certificate for flutter. someone please guide me how to setup google sign in for production
here is the pubspec.yaml file
name: pet_walker
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: ^0.1.3
firebase_auth: ^0.15.0+1
cloud_firestore: ^0.13.7
provider: ^4.3.1
flutter_spinkit: "^4.1.2"
flutter_facebook_login: ^3.0.0
google_sign_in: ^3.2.4
after_layout: ^1.0.7+2
firebase_storage: ^3.1.6
image_picker: ^0.6.7+4
uuid: 2.2.0
cached_network_image: ^2.2.0+1
popup_menu: ^1.0.5
google_maps_flutter: ^0.5.28+1
geolocator: ^5.3.2+2
latlong: ^0.6.1
carousel_slider: ^2.2.1
geocoder: ^0.2.1
geoflutterfire: ^2.1.0
firebase_core: ^0.4.2
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/
# - 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

Flutter import 'package:flutter_svg/flutter_svg.dart'; not working on the VS code and Android studio

I created a Flutter project, and I have an error on the line:
import package:flutter_svg/flutter_svg.dart
I already followed this structure from flutter_svg documentation.
It does not get identified on VS Code and Android Studio.
Any solution for this?
This is my pubspec.yaml
name: first_project
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.1.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
flutter_svg: ^0.18.0
google_fonts: ^1.0.0
flutter_swiper: ^1.1.6
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2
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
assets:
- assets/icons/
- assets/images/
- assets/svg/
# 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
Always remember, indentation plays a huge deal in pubspec.yaml files. Anyway, your dependencies in pubspec.yaml should look something like this:
dependencies:
flutter:
sdk: flutter
flutter_svg: ^0.18.0
google_fonts: ^1.0.0
flutter_swiper: ^1.1.6
Run this package on the terminal
flutter pub add flutter_svg

Categories

Resources