How to configure Dart Editor to build “.UXL” files

2019-07-28 10:43发布

I have the demo code for the Rikulo UXL ScrollView demo working with the Dart Editor.

However, the set-up seems cumbersome to me. For the example to build the .Dart file from the UXL file, (apparently) it needs to be named as: "ScrollView.uxl.xml". Can the build process or Dart Editor be configured and set-up to do a more streamlined workflow like:

ScrollView.uxl --> ScrollView.dart

As opposed to the current rule:

ScrollView.uxl.xml --> ScrollView.uxl.dart

It seem to me the solution seems to lie in the UXL builder:

import 'package:rikulo_uxl/uc.dart';

Solutions welcome.

1条回答
霸刀☆藐视天下
2楼-- · 2019-07-28 11:23

The readme of the package seems to contain exactly the code you are looking for:

https://github.com/rikulo/uxl

add this to your build.dart file (in the directory where your pubspec.yaml file is

import 'package:rikulo_uxl/uc.dart' show build;

void main(List<String> arguments) {
    build(arguments);
}
查看更多
登录 后发表回答