The mapbox gl package page lists it as suitable for web applications (mapbox_gl).
I tried running the example as a web application, but I encounter the error Error creating mapbox_gl_example|lib/move_camera.ddc.dill
Error creating kernel summary for module:mapbox_gl_example|lib/move_camera.ddc.dill
.
So, my question is, is the flutter package mapbox_gl actually able to be run as a web application as the tags "FLUTTER ANDROID IOS WEB" suggest (is there something I must configure), or is it really not web capable as may be indicated by the fact that the actual description mentions nothing of web capability?
Update: The mapbox_gl flutter plugin now has web support merged into master on Github. If you don't want to wait until web support is released to pub.dev, you can depend on the Github repo directly with this dependency in pubspec.yaml:
mapbox_gl:
git:
url: git://github.com/tobrun/flutter-mapbox-gl.git
Outdated answer: Unfortunately, it doesn't support web yet (although PRs are welcome if you want to contribute). The reason it was listed as supporting web (like many other plugins) was that flutter changed the way plugins declare their supported platforms in the pubspec.yaml file. The mapbox_gl package has since been updated on pub.dev and now correctly shows that it only supports Android and iOS.
Related
I get this error in my Flutter Project,
C:\src\flutter\bin\flutter.bat --no-color pub get
Running "flutter pub get" in source_code... 34.3s
This app is using a deprecated version of the Android embedding.
To avoid unexpected runtime failures, or future build failures, try to migrate this app to the V2 embedding.
Take a look at the docs for migrating an app: https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects
The plugin firebase_core requires your app to be migrated to the Android embedding v2. Follow the steps on https://flutter.dev/go/android-project-migration and re-run this command.
Process finished with exit code 1
Flutter Embedding Error
Since Flutter 1.12 the way how Flutter plugins communicate with the native Android side has been improved. Allowing plugins to better integrate with the native Android lifecycle.
Some plugins support both the new and the old structure, however many plugins (like firebase_core) dropped support for the legacy structure to ensure optimal integration with the Android system.
Apps created using Flutter 1.12 and higher automatically generate the correct Android integration logic, however Flutter applications created with an earlier version of Flutter need to be manually migrated. There are two options to fix this for your app:
The easiest solution is to delete the android folder in your project and let Flutter (using Flutter 1.12 or higher) recreate it for you by running the following command in the root folder of the Flutter project: flutter create --platform=android . (don't forget the . at the end of the command). You should only do this if you haven't made any custom changes to the Android code and of course make sure to make a backup first.
The more safe option is to manually migrate the Android project using the instructions provided on the GitHub Wiki page mentioned in the error message.
When following the instructions on the GitHub Wiki page make sure to keep an eye on all the details. Personally I forgot to update the <application android:name="MyApp" to the recommended <application android:name="${applicationName}" which resulted in the same error you are reporting.
What helped me was to create a new "dummy" application with the latest version of Flutter (for example flutter create --platforms=android test_app) and compare the files in the Android folder with the files of my current App and make changes where necessary.
Can you guys tell me what all these different projects means?
New Flutter Project
Because I can't find the documentation anywhere
So if you can find the reference it will help me
Flutter Application: A fully-functional standalone Flutter application.
Flutter Plugin: A plugin is a kind of bridge that you develop between a native feature like camera API in Android and iOS.
Flutter Package: A package is a flutter application written solely using Dart. It doesn't have much to do with the Native functionalities.
Flutter Module: A module is a set of functionalities that you want to use in your app. It is a custom code that does a specific task but can be used for other apps in the future. So, you keep it handy. In other words, this module can be integrated in other apps too.
I'm setting up a new flutter-web application but I can't add dependencies that I could do in flutter.
for example I want to add font-awesome-flutter to the project but get this error!
font_awesome_flutter: 8.5.0
Because font_awesome_flutter >=8.0.0 depends on flutter any from sdk which is forbidden, font_awesome_flutter >=8.0.0 is forbidden.
So, because salema depends on font_awesome_flutter 8.5.0, version solving failed.
since flutter-web is not still stable and its in technical stage, a simple way for using library in flutter-web which has been working for me is to add the library resources manually. you just need to copy everything inside the lib folder of the library in your own project.
in order to access the library's resources go to https://pub.dev/flutter and search for the library you want and then find the library's github repo in the about section.
flutter_web does not have a plugin system yet. Temporarily, we provide
access to dart:html, dart:js, dart:svg, dart:indexed_db and other web
libraries that give you access to the vast majority of browser APIs.
However, expect that these libraries will be replaced by a different
plugin API.
Source:
https://github.com/flutter/flutter_web/blob/master/README.md
In short, Flutter dependencies are not supported by Flutter Web at this time.
I have a mobile app written with flutter and i would like to convert it into a flutter_web app (integrating flutter_web is not available yet).
I'm currently having problems with packages.
I have followed the instructions listed in this website https://www.codemitter.com/how-to-add-web-counterpart-in-an-existing-flutter-project/
I get the following errors
webdev could not run for this project.
You have a dependency on `cached_network_image` which is not supported for flutter_web tech preview. See https://flutter.dev/web for more details.
You have a dependency on `cloud_firestore` which is not supported for flutter_web tech preview. See https://flutter.dev/web for more details.
You have a dependency on `cupertino_icons` which is not supported for flutter_web tech preview. See https://flutter.dev/web for more details.
You have a dependency on `firebase_core` which is not supported for flutter_web tech preview. See https://flutter.dev/web for more details.
You have a dependency on `flutter` which is not supported for flutter_web tech preview. See https://flutter.dev/web for more details.
You have a dependency on `path_provider` which is not supported for flutter_web tech preview. See https://flutter.dev/web for more details.
You have a dependency on `sqflite` which is not supported for flutter_web tech preview. See https://flutter.dev/web for more details.
pub finished with exit code 78
are the flutter_web versions for the following plugins?
how would one manually/automatically change such a plugin to be supported on flutter_web?
Steps to follow while migration to Flutter Web:
update build config according to the migration guide
replace all flutter imports with flutter_web
remove all plugins that depend on native platforms (android or ios) and replace them with equivalents from dart:html or pure dart web libraries (https://pub.dev/web)
use forked non-native libraries that depend on flutter framework, like this https://github.com/rrousselGit/provider/issues/82 you might need to create a fork yourself like this: https://github.com/kevmoo/provider/commit/bb739c96463347dd185331655e1d8895665172b9
Steps 1. and 2. are pice of cake. But 3. and 4. might be very paintful.
Plugins are not yet supported on flutter_web and we don't yet have details on what the migration story will look like. Plugins which call through to native Java or Swift code will not be possible to migrate automatically. Any code which imports dart:io or dart:isolate is also unsupported and would need to be rewritten.
Beginning with Flutter v1.10, you can migrate your Flutter app to Web.
Enable web support by running:
flutter config --enable-web
Now, if you want to create a new project you can run
flutter create project_name
or if you want to migrate your existing one to web, run
flutter create .
Check connected devices by running:
flutter devices
Run your app in chrome by running:
flutter run -d chrome
I am new to flutter plugin development, I have read Developing packages & plugins and Writing a good Flutter plugin, but I am confused as a beginner, I have developed Flutter Application based on webview_flutter and a JavaScript library to work offline. I want to extend it as a module or a plugin.
Webview renders some stuff.
JavaScript library is being attached from assets.
I am not calling any Platform API directly from my code but my code depends on another plugin.
How do I proceed this? As a plugin or as a module?
A plugin is about making native functionality available to Flutter.
A module is about integrating Flutter with an existing native application.
Perhaps what you actually want is a reusable Pub package that you can publish to pub.dartlang.org (a plugin is also a Pub package, just a special one that additionally utilizes access to the native platform)
See also
https://flutter.io/docs/development/packages-and-plugins/developing-packages
https://www.dartlang.org/guides/libraries/create-library-packages
A "library package" is a Pub package in contrary to a plain Dart "application package" which is usually not published to pub.dartlang.org.
A pure Dart Pub package (library package) that does not depend on dart:html, dart:ui (Flutter) and is not a Flutter plugin, can be used on any platform (server, command line, Flutter, browser).
If your package has one of the named dependencies, it is limited to a specific platform.
pub.dartlang.org shows labels to categorize published packages accordingly (FLUTTER,WEB,OTHER)
Flutter plugins:
In short: Native related developments.
Flutter plugin is the wrapper of the native code like android( Kotlin or java) and iOS(swift or objective c). ... Flutter can do anything that a native application can through the use of Platform Channels and Message Passing. Flutter instructs the native iOS/Android code to perform an action and returns the result to Dart.
Flutter packages or modules:
In short: Make the development faster by using code from util libraries.
Flutter supports using shared packages contributed by other developers to the Flutter and Dart ecosystems. This allows quickly building an app without having to develop everything from scratch.