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

2019-07-28 11:17发布

问题:

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

  • UXL Overview

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:

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);
}