how to solve the mapping value error in pubspec.yaml? - flutter

pubspec.yaml
getting this error Error... on line 39, column 10: Mapping values are not allowed here. Did you miss a colon earlier?
name: myvoapp
description: A new Flutter application.
publish_to:
version: 1.0.0+1
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.3
flutter_login: ^1.0.14
record_mp3: ^2.0.0
permission_handler: ^5.0.1+1
path_provider: ^1.6.11
audioplayer: ^0.8.1
stop_watch_timer: ^0.5.0
firebase_core: ^0.4.5
firebase_auth: ^0.16.1
cloud_firestore: ^0.13.7
modal_progress_hud: ^0.1.3
animated_text_kit: ^2.2.0
dev_dependencies:
flutter_test:
sdk: flutter
flutter:
uses-material-design: true
assets:
- images/icon1.png
I checked with spaces but could no solve the issue

Fixed it, your assets indentation was wrong:
Use the content below:
name: myvoapp
description: A new Flutter application.
publish_to:
version: 1.0.0+1
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.3
flutter_login: ^1.0.14
record_mp3: ^2.0.0
permission_handler: ^5.0.1+1
path_provider: ^1.6.11
audioplayer: ^0.8.1
stop_watch_timer: ^0.5.0
firebase_core: ^0.4.5
firebase_auth: ^0.16.1
cloud_firestore: ^0.13.7
modal_progress_hud: ^0.1.3
animated_text_kit: ^2.2.0
dev_dependencies:
flutter_test:
sdk: flutter
flutter:
uses-material-design: true
# assets indentation was wrong
assets:
- images/icon1.png

After try different things the solution for mi was the indentantion, spaces
uses-material-design: true
assets:
- images/
Make sure is align

Related

Flutter Version Solving Failed-- user_model

I got this error message and i'm not sure how to resolve it, please help me below enter image description here
and here's my pubspec.yaml:
description: A new Flutter project.
version: 1.0.0+1
environment:
sdk: ">=2.17.5 <3.0.0"
dependencies:
flutter:
sdk: flutter
dropdown_search: ^5.0.3
user_model: any
cupertino_icons: ^1.0.2
dio: ^4.0.6
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^2.0.0
flutter:
uses-material-design: true
there is no user_model dependency in pub.dev that's why the error occurs

how can I increase my flutter web performance and how can i remove leggence in my flutter web?

I build web application in flutter but the performance of my web application is too bad its not smooth its too much leggy what can I do to solve this problem?
give me suggestions
i also try many solutions but these are not working for my flutter web i also make release of my web that's also leggy like my deub mode.
my pub yaml file
name: doctor appointment
description: Oriel Research Therapeutics online services.
publish_to: 'none'
version: 1.0.0+1
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
# firebase_core: "^0.7.0"
firebase_core: ^1.0.1
# firebase_auth: "^0.20.0+1"
firebase_auth: ^1.0.1
# flutter_signin_button: ^1.1.0
shared_preferences: ^2.0.5
cloud_firestore: ^1.0.4
firebase_storage: ^8.0.6
# The following adds the Cupertino Icons font to your application.
# Use with the Cupertino Icons class for iOS style icons.
cupertino_icons: ^1.0.1
flutter_custom_clippers: ^1.1.2
responsive_builder: ^0.1.2
# velocity_x: ^1.0.1
velocity_x: ^2.6.0
url_launcher: ^6.0.2
provider: ^4.3.2
footer: ^0.0.3
# youtube_player_iframe: ^1.2.0+2
carousel_slider: ^3.0.0
youtube_plyr_iframe: ^2.0.0
get: ^3.25.4
package_info: ^0.4.3+4
modal_progress_hud: ^0.1.3
equatable: ^2.0.0
file_picker: 3.0.0
dio: ^4.0.0
webview_flutter: ^1.0.0
# js: ^0.6.2
page_transition: "^1.1.7+6"
http:
flutter_credit_card: ^2.0.0
font_awesome_flutter: ^9.0.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:
uses-material-design: true
# To add assets to your application, add an assets section, like this:
assets:
- assets/logos/
- assets/services/
- assets/team/
- assets/images/
Try the below Links. Helped me solve some performance issues by getting rid of page transitions.
https://medium.com/flutter/optimizing-performance-in-flutter-web-apps-with-tree-shaking-and-deferred-loading-535fbe3cd674
https://medium.com/flutter/improving-perceived-performance-with-image-placeholders-precaching-and-disabled-navigation-6b3601087a2b

Using --no-tree-shake-icons means no icons appear after building

Currently, I am getting the error This application cannot tree shake icons fonts. When I use --no-tree-shake-icons, none of the material icons appear on the application. I am not sure how to fix this as I cant add const to my icons as they aren't constant:
iconData: IconData(document.data()['ref'], fontFamily: 'MaterialIcons')
Edit:
This is my pubspec.yaml folder:
version: 1.0.0+1
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
table_calendar: ^2.3.3
wave_progress_widget: ^0.0.1
liquid_swipe: ^1.4.3
firebase_helpers: ^0.2.2
firebase_messaging: ^7.0.3
carousel_slider: ^3.0.0
google_fonts: ^1.1.2
date_field: ^1.0.4
cloud_firestore: ^0.14.0+2
intl: ^0.16.1
googleapis: ^0.55.0
googleapis_auth: ^0.2.12
url_launcher: ^5.5.0
get_it: ^5.0.6
flutter:
sdk: flutter
firebase_core: ^0.5.3
firebase_database: "^4.4.0"
cupertino_icons: ^1.0.0
dev_dependencies:
flutter_test:
sdk: flutter
flutter_launcher_icons: "^0.8.1"
flutter_icons:
image_path: "icon/icon.png"
android: true
ios: true
assets:
- assets/
flutter:
uses-material-design: true
I would appreciate any help!

Because flutter_paystack 1.0.2+1 depends on intl ^0.16.0

When I click the run button, I'm getting the error
Because flutter_paystack 1.0.2+1 depends on intl ^0.16.0 and every version of flutter_localizations from sdk depends on intl
0.17.0-nullsafety.2, flutter_paystack 1.0.2+1 is incompatible with flutter_localizations from sdk.
here is my pubspec.yml file code
name: my app
description: A new Flutter application.
publish_to: 'none'
version: 1.0.0+1
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
cupertino_icons: ^0.1.2
scoped_model: ^1.0.1
rxdart: ^0.24.0
http: ^0.12.0+2
json_annotation: ^2.0.0
flutter_html: ^1.0.2
flutter_swiper: ^1.1.6
cached_network_image: ^2.3.3
shared_preferences: ^0.5.7+3
country_code_picker: ^1.1.7
url_launcher: ^5.4.11
timeago: ^2.0.26
flutter_rating_bar: ^3.2.0
webview_flutter: ^0.3.18+1
font_awesome_flutter: ^8.5.0
share: ^0.6.5+4
place_picker: ^0.9.17
location: 2.3.5
fluttertoast: ^3.1.3
flutter_paystack: 1.0.2+1
sign_in_with_apple: ^2.5.2
image_picker: ^0.6.6+4
flutter_webview_plugin: 0.3.10+1
smooth_star_rating: ^1.1.1
flutter_icons: ^1.1.0
firebase_auth: ^0.18.0+1
google_sign_in: ^4.5.1
flutter_facebook_login: ^3.0.0
fab_circular_menu: ^0.1.4
google_fonts: ^0.3.5
stripe_payment: ^1.0.7
network_to_file_image: ^2.3.1
geocoder: ^0.2.1
firebase_core: 0.5.0
firebase_analytics: 6.0.0
firebase_storage: 4.0.0
cloud_firestore: 0.14.0+2
photo_view: ^0.10.2
intro_slider: ^2.3.1
#onesignal_flutter: ^2.6.1
firebase_messaging: 7.0.0
rounded_loading_button: ^1.0.14
pin_code_fields: ^5.2.0
gradient_input_border: ^1.0.0
devicelocale: ^0.3.3
lottie: ^0.7.0+1
webview_cookie_manager: ^1.0.4
dev_dependencies:
flutter_test:
sdk: flutter
flutter_native_splash: ^0.1.9
change_app_package_name: ^0.1.2
flutter_launcher_icons: ^0.8.0
flutter_native_splash:
image: lib/assets/images/splash.jpg
color: "ffffff"
flutter_icons:
android: "launcher_icon"
ios: true
image_path: "lib/assets/images/icon.png"
flutter:
uses-material-design: true
assets:
- lib/assets/images/
- lib/assets/images/intro/
fonts:
- family: MStoreIcons
fonts:
- asset: lib/assets/fonts/Icons/MStoreIcons.ttf
- family: Lexend_Deca
fonts:
- asset: lib/assets/fonts/Lexend_Deca/Lexend_Deca-Regular.ttf
How do I solve this?
It is an issue with flutter_localizations package, The solution is to downgrade flutter or put these lines inside pubspec.yaml after dev_dependencies block.
dependency_overrides:
intl: ^0.17.0-nullsafety.2
Regards.

i m tring to create app using goolge maps detected in pubspec.yaml: Error on line 30, column 3: Expected a key while parsing a block mapping

I'm trying to create an app using google maps with live location, but when i add some dependencies i got this problem.
environment:
sdk: ">=2.1.0 <3.0.0"
> dependencies:
flutter:
sdk: flutter
google_maps_flutter: ^0.5.11
http: ^0.12.0+1
json_serializable: ^2.0.2
**dev_dependencies:**
flutter_test:
sdk: flutter
pedantic: ^1.4.0
build_runner: ^1.2.7
*flutter:*
uses-material-design: true ```
Can you share the full pubspec.yaml?
It shoud be like:
name: myapp
description: My App
version: 1.0.0
environment:
sdk: ">=2.1.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.2
google_maps_flutter: ^0.5.21+2