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
Related
flutter run works but flutter run --release or flutter run --release --profile returns the error below:
===== CRASH =====
si_signo=Segmentation fault: 11(11), si_code=1, si_addr=0x0
version=2.18.6 (stable) (Tue Dec 13 21:15:14 2022 +0000) on "macos_simarm64"
pid=14192, thread=-1, isolate_group=isolate(0x7f910c011200), isolate=(nil)(0x0)
isolate_instructions=0, vm_instructions=0
Stack dump aborted because InitialRegisterCheck failed.
Dart snapshot generator failed with exit code -6
Here's my pubspec.yaml dependencies:
version: 1.0.0+1
environment:
sdk: ">=2.15.1 <3.0.0"
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
flutter_native_splash: ^2.1.6
table_calendar: ^3.0.8
image_stack: ^2.1.1
intl: ^0.17.0
shimmer: ^2.0.0
flutter_riverpod: ^1.0.4
auto_route: ^5.0.4
google_fonts: ^3.0.1
pinput: ^2.2.9
mask_text_input_formatter: ^2.3.0
firebase_core: ^1.21.1
dio: ^4.0.6
dio_cache_interceptor: ^3.2.7
dio_cache_interceptor_hive_store: ^3.1.1
http: ^0.13.5
enum_to_string: ^2.0.1
mobile_scanner: ^2.1.0
firebase_auth: ^3.3.19
image_picker: ^0.8.5+3
image_cropper: ^3.0.1
firebase_storage: ^10.2.18
fluttertoast: ^8.0.9
firebase_messaging: ^13.0.1
hive: ^2.2.1
hive_flutter: ^1.1.0
flutter_hooks: ^0.18.5+1
hooks_riverpod: ^1.0.4
local_auth: ^2.1.0
lottie: ^2.1.0
flutter_local_notifications: ^9.7.0
device_info_plus: ^4.0.1
timeago: ^3.2.2
url_launcher: ^6.1.5
focused_menu: ^1.0.5
rxdart: ^0.27.7
rate_my_app: ^1.1.3
infinite_scroll_pagination: ^3.2.0
flutter_offline: ^2.1.0
webview_flutter: ^4.0.1
shared_preferences: ^2.0.15
web_socket_channel: ^2.2.0
fl_chart: ^0.55.2
dev_dependencies:
#flutter_gen_runner:
auto_route_generator: ^5.0.2
firebase_core_platform_interface: ^4.5.1
build_runner: any
flutter_lints: ^2.0.1
flutter_launcher_icons: ^0.11.0
flutter_test:
sdk: flutter
flutter_icons:
android: "launcher_icon"
ios: true
image_path: "assets/icons/b2b_logo.png"
flutter:
uses-material-design: true
generate: true
assets:
- assets/images/
- assets/
- assets/animations/
- assets/icons/
fonts:
- family: SnagIcons
fonts:
- asset: assets/fonts/SnagIcons.ttf</summary>
The application from 2 months ago was building successfully but as of last week, I have been getting this issue and reverting the changes i still get the same issue.
Try to switch to flutter dev channel and back to flutter stable.
Do a flutter clean and flutter pub get and try it again.
This occours because of the some updates in the packages
Try entering the below code in the vs code terminal:
flutter clean
flutter pub get
Your flutter code will work like a charm!
Edit:
There are github issues which address this,see if any works for you
https://github.com/flutter/flutter/issues/43707
https://github.com/flutter/flutter/issues/109818
https://github.com/flutter/flutter/issues/43597
So, after raising the issue on the flutter channel, the problem was caused by returning a late variable from a future method so there was a fix in the release of flutter 3.7 which will remedy this problem
You can view the issue here on GitHub
I upgraded flutter to the latest version and now everytime I try build I get this error.
Invalid plugin specification moor_ffi.
Cannot find the flutter.plugin.platforms key in the pubspec.yaml file. An instruction to format the pubspec.yaml
can be found here: https://flutter.dev/docs/development/packages-and-plugins/developing-packages#plugin-platforms
I'm not quite sure how to go about fixing this since there isn't much online about this error and I only started using flutter in the past couple of days.
Here is my pubspec.yaml file
name: pattle
description: An easy to use Matrix app.
environment:
sdk: ">=2.6.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
matrix_sdk: ^0.33.0+1
async: ^2.3.0
bloc: ^3.0.0
flutter_bloc: ^3.2.0
provider: ^4.0.1
equatable: ^1.0.1
intl: ^0.17.0
cached_network_image: ^2.2.0+1
flutter_cache_manager: ^1.1.3
path_provider: ^1.6.5
path: ^1.6.4
sentry: ^3.0.1
device_info: ^0.4.1+1
package_info: ^0.4.0+5
# TODO: Use official package when PR is merged
flutter_html:
git:
url: https://github.com/pattle-org/flutter_html.git
ref: 71406a09f9e591f9d35635e6a086007ccc678ae3
flutter_dotenv: ^2.0.1
transparent_image: ^1.0.0
photo_view: ^0.4.2
url_launcher: ^5.1.0
image_picker: ^0.6.1+3
image: ^2.1.4
mime: ^0.9.6+3
shared_preferences: ^0.5.3+4
mdi: ^2.0.0
shimmer: ^1.1.0
flutter_svg: ^0.17.3+1
animations: ^1.0.0+5
characters: ^1.1.0
vibration: ^1.2.4
video_player: '>=0.10.11+1 <2.0.0'
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2
firebase_core: ^0.4.0+9
firebase_messaging: ^6.0.13
flutter_local_notifications: ^0.8.4
dependency_overrides:
moor_ffi: 0.5.0
intl: 0.17.0-nullsafety.2
dev_dependencies:
flutter_launcher_icons: ^0.7.2+1
flutter_test:
sdk: flutter
effective_dart: ^1.2.1
intl_translation: ^0.17.9
flutter_icons:
android: true
ios: true
image_path_android: "assets/logo/launcher.png"
image_path_ios: "assets/logo/launcher_full.png"
adaptive_icon_background: "#aa4139"
adaptive_icon_foreground: "assets/logo/launcher_foreground.png"
# 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
assets:
- .env
- assets/logo/logo.svg
fonts:
- family: CreteRound
fonts:
- asset: assets/fonts/crete_round_regular.ttf
- asset: assets/fonts/crete_round_italic.ttf
style: italic
Any ideas what is causing this?
This may be the answer
https://github.com/simolus3/moor/issues/727#issuecomment-662935493
But I'm not sure what this person means by
add a dependency on the new sqlite3_flutter_libs package
drop the moor_ffi dependency and replace imports with the new package:moor/ffi.dart library
Since I'm very new to flutter
flutter clean; pubdev get
worked for me
I can't import the firebase_auth package in Flutter. I did everything they said in the installation part (as shown below). Other packages are imported and working properly, but firebase_auth isn't.
name: flash_chat
description: A new Flutter application.
version: 1.0.0+1
environment:
sdk: ">=2.1.0<3.0.0"
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.2
animated_text_kit: ^2.2.0
firebase_core: ^0.5.0
firebase_auth_platform_interface: ^2.0.1
firebase_auth_web: ^0.3.0+1
firebase_core_platform_interface: ^2.0.0
cloud_firestore: ^0.14.0+2
firebase_analytics: ^6.0.0
firebase_messaging: ^7.0.0
firebase_auth: ^0.18.0+1
dev_dependencies:
flutter_test:
sdk: flutter
flutter:
uses-material-design: true
assets:
- images/
And I did the pub get. Can anybody help me?
These are a few suggested solutions:
Reload your IDE
Delete your pubspec.lock file and re run pub get.
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
i just add new dependencies to pubspec.yaml, it's firebase_admob: ^0.8.0+3 but after adding it i got app crash at launch.
here're my other dependencies, any idea to solve ?
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: ^0.1.2
shared_preferences: ^0.5.1+1
rxdart: ^0.20.0
font_awesome_flutter: ^8.2.0
geolocator: '^3.0.0'
localstorage: ^1.2.0
crypto: ^2.0.6
dio: ^2.0.0
pigment: ^1.0.3
validate: ^1.6.0
hijri: ^0.2.5
device_id: ^0.1.3
vibrate: ^0.0.4
date_format: ^1.0.5
cron: ^0.2.1
audioplayers: ^0.9.0
google_fonts_arabic: ^1.1.7
unicode: ^0.1.0
flutter_html: ^0.8.2
flutter_compass: ^0.1.0
google_sign_in: ^4.0.1+1
http: ^0.11.3+16
easy_alert: ^0.0.2
google_maps_flutter: ^0.2.0
app_settings: ^1.0.5
flutter_local_notifications: ^0.5.0
cached_network_image: ^0.6.0
firebase_admob: ^0.8.0+3
flutter_facebook_login:
git:
url: https://github.com/roughike/flutter_facebook_login
ref: e69fef3
firebase_auth: ^0.8.2
esys_flutter_share: ^0.0.9
dev_dependencies:
flutter_test:
sdk: flutter
I need to see error messages but probably it’s about Android X. Reduce the package version or migrate your project to android x.
Another related question
Change log: