trans2fw 0.0.2

trans2fw 是一个快速将 flutter native 开发的文件转换成 flutter-web 的工具。

目前工具只对【官方常用的代码库】转换成web版本,后续会增加更多第三方库的支持。 包括但不限于如下:

package:flutter/material.dart -> package:flutter_web/material.dart
package:flutter/widgets.dart -> package:flutter_web/widgets.dart
package:flutter/cupertino.dart -> package:flutter_web/cupertino.dart
package:flutter/services.dart -> package:flutter_web/services.dart
package:flutter/rendering.dart -> package:flutter_web/rendering.dart
package:flutter/gestures.dart -> package:flutter_web/gestures.dart
dart:ui -> package:flutter_web_ui/ui.dart

使用前准备 #

使用pub global命令将文件包注册到全局 #

pub global activate trans2fw

使用pub global run命令运行注册的脚本文件 #

pub global run trans2fw

运行 trans2fw 工具,根据提示输入

$ trans2fw

[✓] 请输入需要转换的文件目录(相对于项目目录): lib-cp
[✓] 是否覆盖原有文件 ?  (y/N) y
{path: lib-cp, cover: true}
使用输入文件目录:lib-cp
被转换的文件::lib-cp/Pagination.dart::32
...

Use this package as an executable

1. Install it

You can install the package from the command line:


$ pub global activate trans2fw

2. Use it

The package has the following executables:


$ trans2fw
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
90
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
30
Overall:
Weighted score of the above. [more]
33
Learn more about scoring.

We analyzed this package on Dec 9, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.1
  • pana: 0.12.21

Health suggestions

Fix bin/trans2fw.dart. (-9.08 points)

Analysis of bin/trans2fw.dart reported 19 hints, including:

line 9 col 8: Unused import: 'dart:async'.

line 11 col 8: Unused import: 'dart:convert'.

line 14 col 8: Unused import: 'package:path/path.dart'.

line 34 col 10: The value of the local variable 'select' isn't used.

line 57 col 21: Unnecessary new keyword.

Fix bin/main.dart. (-0.50 points)

Analysis of bin/main.dart reported 1 hint:

line 1 col 1: Prefer using /// for doc comments.

Maintenance issues and suggestions

Provide a file named CHANGELOG.md. (-20 points)

Changelog entries help developers follow the progress of your package. See the example generated by stagehand.

The description contains too many non-ASCII characters. (-20 points)

The site uses English as its primary language. The value of the description field in your package's pubspec.yaml field should primarily contain characters used in English.

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

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.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
args ^1.5.2 1.5.2
console ^3.1.0 3.1.0
dart_inquirer ^1.0.0 1.0.0
path ^1.6.4 1.6.4
Transitive dependencies
vector_math 2.0.8