我有一个Flutter应用程序,它在每个平台(移动设备、Web和Windows)上使用不同的WebView插件。
尽管我能够基于web
和mobile
进行import
,但我无法为Windows导入。
我已经尝试添加else条件,以防不是移动设备或Web,但它会使用mobile
插件。
- 这是我为Web和移动设备导入包的方式(有效)。
import 'package:eam_flutter/form/mobileui.dart'
if (dart.library.html) 'package:eam_flutter/form/webui.dart'
as multiPlatform;
- 这是我在网页、移动设备和Windows中导入包的方法(但由于不支持桌面端,它无法正常工作,显示移动设备的webview异常)。
import 'package:eam_flutter/form/windowui.dart'
if (dart.library.html) 'package:eam_flutter/form/webui.dart'
if (dart.library.io) 'package:eam_flutter/form/mobileui.dart'
as multiPlatform;
我该如何为 Windows 指定条件导入?
completer.complete(files.map((html.File file)
- user40823