ngflutter 0.5.0

  • Readme
  • Changelog
  • Installing
  • 42

Flutter CLI #

Pub Package Build Status

A command line interface for Flutter. It can scaffold a skeleton Flutter project, component, and test with page object.

Installation #

To install:

pub global activate ngflutter
pub global activate webdev

To update:

pub global activate ngflutter
pub global activate webdev

Usage #

ngflutter help

For help on specific command, run ngflutter help [command name] For example:

ngflutter help generate test

will show how to use command generate test.

Generating Flutter project #

ngflutter new project_name
cd project_name
pub get
webdev serve

Navigate to http://localhost:8080 to visit the project you just built. Command following will assume that you are in the root directory of the project.

Generating component #

ngflutter generate component AnotherComponent

This command will generate component under folder lib/. You can use option -p to change the folder.

Generating test #

ngflutter generate test lib/app_component.dart

Command above will generate 2 files. One is page object file and the other one is test file. Test generated is using flutter_test and test package.

Use command

pub run build_runner test --fail-on-severe -- -p chrome

to run generated test with Chrome.

Changelog #

0.4.0 #

  • Fixing Bugs Related to dart2native

0.3.1 #

  • Added support for Flutter

0.1.2 #

  • Added support for generate directive
  • Added support for generate pipe

0.1.1 #

  • Fixed issues on Windows.

0.1.0+3 #

  • Exported visitors which can be used to extract info from Dart files.

0.1.0+2 #

  • Fixed an issue on README.md formatting.
  • Enabled travis.

0.1.0+1 #

  • Added missing dependencies.

0.1.0 #

  • New implementation, support to create project, generate Flutter component and test.

0.0.2 #

  • Fixed scaffold command so that it uses the correct platform separator. Instead of creating files in the CWD, it creates them in $name/lib and $name/test of the CWD.

0.0.1 #

  • Added scaffold command, which generates all of the files need for a component. This should be run from an empty folder and provider a selector name like my-foo-bar.

Use this package as an executable

1. Install it

You can install the package from the command line:


$ pub global activate ngflutter

2. Use it

The package has the following executables:


$ ngflutter

Use this package as a library

1. Depend on it

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


dependencies:
  ngflutter: ^0.5.0

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:ngflutter/visitors.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
60
Overall:
Weighted score of the above. [more]
42
Learn more about scoring.

We analyzed this package on Mar 27, 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 suggestions

Fix lib/src/app_logger.dart. (-0.50 points)

Analysis of lib/src/app_logger.dart reported 1 hint:

line 28 col 70: Avoid using braces in interpolation when not needed.

Format lib/src/command_runner.dart.

Run flutter format to format lib/src/command_runner.dart.

Format lib/src/commands/generate.dart.

Run flutter format to format lib/src/commands/generate.dart.

Fix additional 3 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/src/commands/new.dart (Run flutter format to format lib/src/commands/new.dart.)
  • lib/src/package_uri_resolver.dart (Run flutter format to format lib/src/package_uri_resolver.dart.)
  • lib/src/project_model.dart (Run flutter format to format lib/src/project_model.dart.)

Maintenance issues and suggestions

Support latest dependencies. (-10 points)

The version constraint in pubspec.yaml does not support the latest published versions for 1 dependency (analyzer).

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

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 ngflutter.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.69.0 <3.0.0
analyzer ^0.32.4 0.32.6 0.39.4
ansicolor ^1.0.2 1.0.2
args ^1.5.3 1.6.0
html ^0.14.0+3 0.14.0+3
logging ^0.11.3+2 0.11.4
path ^1.6.2 1.6.4
recase ^3.0.0 3.0.0
reflected_mustache ^1.0.11 1.0.11
resource ^2.1.5 2.1.6
Transitive dependencies
async 2.4.1
build 0.12.8 1.2.2
build_config 0.3.2 0.4.2
build_resolvers 0.2.2+7 1.3.3
build_runner 0.10.3 1.8.0
build_runner_core 1.0.0 4.5.3
built_collection 4.3.2
built_value 7.0.9
charcode 1.1.3
code_builder 3.2.1
collection 1.14.12
convert 2.1.1
crypto 2.1.4
csslib 0.16.1
dart_style 1.1.3 1.3.3
fixnum 0.10.11
front_end 0.1.4+2 0.1.29
glob 1.2.0
graphs 0.1.3+1 0.2.0
http 0.12.0+4
http_multi_server 2.2.0
http_parser 3.1.4
io 0.3.3
js 0.6.1+1
json_annotation 1.2.0 3.0.1
kernel 0.3.4+2 0.3.29
matcher 0.12.6
meta 1.1.8
mime 0.9.6+3
node_interop 1.0.3
node_io 1.0.1+2
package_config 1.9.3
package_resolver 1.0.10
pedantic 1.9.0
plugin 0.2.0+3
pool 1.4.0
pub_semver 1.4.4
pubspec_parse 0.1.4 0.1.5
quiver 2.1.3
reflectable 2.0.7 2.2.4
shelf 0.7.5
shelf_web_socket 0.2.3
source_span 1.4.1 1.7.0
stack_trace 1.9.3
stream_channel 2.0.0
stream_transform 0.0.20 1.2.0
string_scanner 1.0.5
timing 0.1.1+2
typed_data 1.1.6
watcher 0.9.7+14
web_socket_channel 1.1.0
yaml 2.2.0
Dev dependencies
flutter
test ^1.3.0