nuts 2.1.4

  • Readme
  • Changelog
  • Installing
  • 36

nuts #

Nuts and bolts for building cross-platform UI (HTML, Flutter, CLI) using Dart. Also screw frameworks (React, Vue, Angular).

Example #

class Counter implements Component {
  @override
  String key;

  int count = 0;

  @override
  View makeView() {
    Box ret;
    ret = Box(children: [
      TextField('Count: $count', key: 'info'),
      HBox(children: [
        Button(
            text: 'Increment',
            onClick: () {
              ret.getByKey<TextField>('info').text = 'Count: ${++count}';
            }),
        Button(
            text: 'Decrement',
            onClick: () {
              ret.getByKey<TextField>('info').text = 'Count: ${--count}';
            }),
      ]),
    ]);
    return ret;
  }
}

void main() {
  querySelector('#output').append(defaultRenderers.render(Counter()));
}

1.0.0 #

  • Initial version, created by Stagehand

Use this package as a library

1. Depend on it

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


dependencies:
  nuts: ^2.1.4

2. Install it

You can install packages from the command line:

with pub:


$ pub get

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

3. Import it

Now in your Dart code, you can use:


import 'package:nuts/nuts.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
68
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
36
Learn more about scoring.

We analyzed this package on Oct 16, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.5.1
  • pana: 0.12.21

Platforms

Detected platforms: web

Primary library: package:nuts/nuts.dart with components: html.

Health issues and suggestions

Document public APIs. (-0.78 points)

540 out of 544 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.

Fix lib/html_renderer/html_renderer.dart. (-25.97 points)

Analysis of lib/html_renderer/html_renderer.dart reported 60 hints, including:

line 37 col 9: DO use curly braces for all flow control structures.

line 44 col 9: DO use curly braces for all flow control structures.

line 51 col 9: DO use curly braces for all flow control structures.

line 58 col 9: DO use curly braces for all flow control structures.

line 76 col 9: DO use curly braces for all flow control structures.

Fix lib/view/containers.dart. (-2.96 points)

Analysis of lib/view/containers.dart reported 6 hints, including:

line 96 col 9: Use isEmpty instead of length

line 154 col 16: Use = to separate a named parameter from its default value.

line 202 col 9: Use isEmpty instead of length

line 304 col 9: Use isEmpty instead of length

line 406 col 9: Use isEmpty instead of length

Fix lib/view/editable.dart. (-1.49 points)

Analysis of lib/view/editable.dart reported 3 hints:

line 31 col 22: Use = to separate a named parameter from its default value.

line 69 col 22: Use = to separate a named parameter from its default value.

line 220 col 22: Use = to separate a named parameter from its default value.

Fix additional 4 files with analysis or formatting issues. (-2.50 points)

Additional issues in the following files:

  • lib/view/measure.dart (2 hints)
  • lib/view/table.dart (2 hints)
  • lib/view/event.dart (1 hint)
  • lib/view/view.dart (Run dartfmt to format lib/view/view.dart.)

Maintenance suggestions

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and nuts.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Package is getting outdated. (-9.86 points)

The package was last published 57 weeks ago.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.65.0 <3.0.0
collection ^1.14.10 1.14.12
observable_ish ^2.1.4 2.1.4
Dev dependencies
build_runner ^0.9.0
build_web_compilers ^0.4.0