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}

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
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 Jul 2, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.9+1

Health issues and suggestions

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

Analysis of bin/trans2fw.dart failed with 1 error, 11 hints, including:

line 91 col 20: This requires the 'control-flow-collections' experiment to be enabled.

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

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

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

No valid SDK. (-20 points)

The analysis could not detect a valid SDK that can use this package.

Make sure dartdoc successfully runs on your package's source files. (-10 points)

exitCode: 255 stdout: Documenting trans2fw... Initialized dartdoc with 37 libraries in 30.5 seconds Validating docs... no issues found Documented 0 public libraries in 5.5 seconds stderr: Unhandled exception: dartdoc could not find any libraries to document #0 Dartdoc.generateDocs (package:dartdoc/dartdoc.dart:218:9)

Provide a file named (-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.


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