目前工具只对【官方常用的代码库】转换成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 activate trans2fw
pub global run trans2fw
$ trans2fw
[✓] 请输入需要转换的文件目录(相对于项目目录): lib-cp
[✓] 是否覆盖原有文件 ? (y/N) y
{path: lib-cp, cover: true}
使用输入文件目录:lib-cp
被转换的文件::lib-cp/Pagination.dart::32
...