nuts 2.1.4

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 40

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';
  
Version Uploaded Documentation Archive
2.1.4 Sep 10, 2018 Go to the documentation of nuts 2.1.4 Download nuts 2.1.4 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
74
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
40
Learn more about scoring.

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

  • Dart: 2.3.2
  • pana: 0.12.18

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. (-19.79 points)

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

line 95 col 9: The value of the local variable 'minHeightSub' isn't used.

line 100 col 9: The value of the local variable 'maxHeightSub' isn't used.

line 104 col 9: The value of the local variable 'bgColorSub' isn't used.

line 109 col 9: The value of the local variable 'bgImageSub' isn't used.

line 114 col 9: The value of the local variable 'colorSub' isn't used.

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.

Dependencies

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