Migrate To Web #
Automatially migrate your current Flutter projects to be compatible with Flutter Web. The current workflow suggested by the Flutter team is to create a copy of your app's code and change it according to their migration guide. This tool automates all those steps and creates a nice little Flutter Web project out of your current one.
How To use it #
From the root of your flutter project run
flutter pub run migrate_to_web
This will automatically create a project in the same parent directory with the suffix
To use a different name for the web project, use the argument
-n or --name.
flutter pub run migrate_to_web -n my_web_project
If you make changes to your project, just run the same command and it will update the web project.
- [ ] Handle assets and fonts
- [ ] Add tests for updating situations
PRs & issues welcome 😛
- Migrate fonts listed in
Use this package as a library
1. Depend on it
Add this to your package's pubspec.yaml file:
dependencies: migrate_to_web: ^0.0.2
2. Install it
You can install packages from the command line:
$ pub get
$ flutter pub get
Alternatively, your editor might support
pub get or
flutter pub get.
Check the docs for your editor to learn more.
3. Import it
Now in your Dart code, you can use:
import 'package:migrate_to_web/main.dart'; import 'package:migrate_to_web/web_file_strings.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
We analyzed this package on Nov 7, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
- Dart: 2.6.0
- pana: 0.12.21
Detected platforms: Flutter, other
lib/main.dart. (-1.99 points)
lib/main.dart reported 4 hints:
line 10 col 58: Use
lowercase_with_underscores when specifying a library prefix.
line 122 col 9: The value of the local variable 'fontsDir' isn't used.
line 153 col 11: Equality operator
== invocation with references of unrelated types.
line 195 col 6: The declaration '_runFlutterPackagesGet' isn't referenced.
Maintain an example. (-10 points)
Create a short demo in the
example/ directory to show how to use this package.
Common filename patterns include
migrate_to_web.dart. Packages with multiple examples should provide
For more information see the pub package layout conventions.
Package is pre-v0.1 release. (-10 points)
While nothing is inherently wrong with versions of
0.0.*, it might mean that the author is still experimenting with the general direction of the API.
|Dart SDK||>=2.2.0 <3.0.0|