tree_force 0.2.1+1

  • Readme
  • Changelog
  • Example
  • Installing
  • 50

Tree Force #

A web ui framework based on a widget tree inspired by Flutter.

Experimental #

This package is in a proof-of-concept phase and is highly experimental. There is a good chance that the API will break with a new version of the package. Furthermore, don't expect high quality yet.

Roadmap #

  • Replace AngularDart in an internal use case (required features: some layout, images, text inputs, buttons, router, forms)
  • Optimize widget tree rebuild (currently the complete widget tree is rebuild even in the case a single leave has a state change)
  • Introduce keys for widgets in lists
  • Evaluate an in-code alternative for CSS
  • Implement more widgets
  • Tests
  • Documentation

Changelog #

0.1.0 #

  • Initial version.

0.2.0 #

  • Added minified version of incremental-dom.
  • Bugfix: Fixed an exception, when tree_force is compiled with dart2js.

0.2.1 #

  • Added widgets InputListener, CheckBox and BulletList.

0.2.1+1 #

  • Now uses package incremental_dom_bindings.
  • Fixed some health and maintenance issues.


import 'dart:async';

import 'package:tree_force/tree_force.dart';
import 'package:tree_force/tree_force_basic.dart';
import 'package:tree_force/tree_force_fx.dart';
import 'package:tree_force/tree_force_layout.dart';

void main() {
          opacity: 1.0,
          child: Padding(
              insets: Insets(top: pixel(20)),
              child: Stack(children: [
                  width: percentage(100.0),
                  height: pixel(400),
                  child: Row(children: [
//                    Size(
//                        width: pixel(200),
//                        child: Align(
//                          vertical:,
//                          child: Image(
//                            title: 'Dart',
//                            src: 'dart.svg',
//                          ),
//                        )),
                    Column(children: [
                          initial: 0,
                          stream: Stream<int>.periodic(Duration(seconds: 2), (count) => count + 1),
                          builder: (state) {
                            return Text(text: 'builder: ${state}');
                      Text(key: 'key1', text: 'E-Mail'),
                      Text(text: 'Nickname'),
                        placeholder: 'test',
                        initialValue: 'foo',
                        onInput: (text) => print('value of input: $text'),
                        flexGrow: 1,
                        child: Align(
                          vertical: VerticalAlignment.bottom,
                          child: Button.text(
                            text: 'Sign In',
                            classes: ['foo'],
                            onClick: () => print('button was clicked!'),

class SimpleStateless extends StatelessWidget {
  Widget build(BuildContext context) {
    return Row(
      children: [
        Text(text: 'Hello'),
          insets: Insets(left: pixel(10)),
          child: Text(text: 'World'),

class SimpleStateful extends StatefulWidget {
  final String prefix;


  State<StatefulWidget> createState() {
    return _SimpleState(this);

class _SimpleState extends State<SimpleStateful> {
  int counter = 0;

  _SimpleState(SimpleStateful widget) : super(widget) {
    Timer.periodic(Duration(seconds: 1), (_) => setState(() => counter++));

  Widget build(BuildContext context) {
    return Text(text: '${widget.prefix}: $counter');

  String toString() {
    return '_SimpleState{counter: $counter}';

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  tree_force: ^0.2.1+1

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:tree_force/tree_force.dart';
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 Apr 7, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.6

Health issues and suggestions

Document public APIs. (-0.07 points)

456 out of 471 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Format lib/src/tree_force/change_listener.dart.

Run dartfmt to format lib/src/tree_force/change_listener.dart.

Format lib/src/tree_force/framework.dart.

Run dartfmt to format lib/src/tree_force/framework.dart.

Format lib/src/tree_force/html_node.dart.

Run dartfmt to format lib/src/tree_force/html_node.dart.

Fix additional 22 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/src/tree_force/html_tag.dart (Run dartfmt to format lib/src/tree_force/html_tag.dart.)
  • lib/src/tree_force/input_listener.dart (Run dartfmt to format lib/src/tree_force/input_listener.dart.)
  • lib/src/tree_force/interaction_listener.dart (Run dartfmt to format lib/src/tree_force/interaction_listener.dart.)
  • lib/src/tree_force/length.dart (Run dartfmt to format lib/src/tree_force/length.dart.)
  • lib/src/tree_force/widget.dart (Run dartfmt to format lib/src/tree_force/widget.dart.)
  • lib/src/tree_force_basic/builder.dart (Run dartfmt to format lib/src/tree_force_basic/builder.dart.)
  • lib/src/tree_force_basic/button.dart (Run dartfmt to format lib/src/tree_force_basic/button.dart.)
  • lib/src/tree_force_basic/checkbox.dart (Run dartfmt to format lib/src/tree_force_basic/checkbox.dart.)
  • lib/src/tree_force_basic/image.dart (Run dartfmt to format lib/src/tree_force_basic/image.dart.)
  • lib/src/tree_force_basic/input.dart (Run dartfmt to format lib/src/tree_force_basic/input.dart.)
  • lib/src/tree_force_basic/label.dart (Run dartfmt to format lib/src/tree_force_basic/label.dart.)
  • lib/src/tree_force_basic/list.dart (Run dartfmt to format lib/src/tree_force_basic/list.dart.)
  • lib/src/tree_force_basic/router.dart (Run dartfmt to format lib/src/tree_force_basic/router.dart.)
  • lib/src/tree_force_basic/style.dart (Run dartfmt to format lib/src/tree_force_basic/style.dart.)
  • lib/src/tree_force_form/form.dart (Run dartfmt to format lib/src/tree_force_form/form.dart.)
  • lib/src/tree_force_form/form_field.dart (Run dartfmt to format lib/src/tree_force_form/form_field.dart.)
  • lib/src/tree_force_layout/align.dart (Run dartfmt to format lib/src/tree_force_layout/align.dart.)
  • lib/src/tree_force_layout/fixed.dart (Run dartfmt to format lib/src/tree_force_layout/fixed.dart.)
  • lib/src/tree_force_layout/flex.dart (Run dartfmt to format lib/src/tree_force_layout/flex.dart.)
  • lib/src/tree_force_layout/scroll_box.dart (Run dartfmt to format lib/src/tree_force_layout/scroll_box.dart.)
  • lib/src/tree_force_layout/stack.dart (Run dartfmt to format lib/src/tree_force_layout/stack.dart.)
  • lib/src/tree_force_redux/store_connector.dart (Run dartfmt to format lib/src/tree_force_redux/store_connector.dart.)


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
incremental_dom_bindings ^1.0.0 1.0.0+1
redux ^4.0.0 4.0.0
vector_math ^2.0.8 2.0.8
Dev dependencies
build_runner ^1.7.0
build_web_compilers ^2.8.0