migrate_to_web 0.0.2

  • Readme
  • Changelog
  • Installing
  • 45

Migrate To Web #

pub package

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 _web.

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.

To-do #

  • [ ] Handle assets and fonts
  • [ ] Add tests for updating situations

PRs & issues welcome 😛

0.0.2 #

  • Migrate fonts listed in pubspec.yaml

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  migrate_to_web: ^0.0.2

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ 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]
Learn more about scoring.

We analyzed this package on Jan 25, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.0
  • pana: 0.13.4

Health suggestions

Fix lib/main.dart. (-2.48 points)

Analysis of lib/main.dart reported 5 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 123 col 25: Unnecessary new keyword.

line 153 col 11: Equality operator == invocation with references of unrelated types.

line 195 col 6: The declaration '_runFlutterPackagesGet' isn't referenced.

Maintenance suggestions

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and migrate_to_web.dart. Packages with multiple examples should provide example/README.md.

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.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.2.0 <3.0.0
args ^1.5.2 1.5.2
cli_util ^0.1.3 0.1.3+2
meta ^1.1.7 1.1.8
path ^1.6.4 1.6.4
yaml ^2.1.16 2.2.0
Transitive dependencies
charcode 1.1.2
collection 1.14.12
source_span 1.6.0
string_scanner 1.0.5
term_glyph 1.1.0
Dev dependencies
test ^1.6.3