bloc_cli 0.1.3-dev

bloc_cli #

Create command line interfaces from your BLoCs.

Quickstart #

class ExampleBloc {
  Sink<int> get add => ...;
  Stream<int> get count => ...;
}

Future main() async {
  final cli = BlocCli("Example", ExampleBloc(), (bloc) => bloc.dispose())
    ..stream("count", (b) => b.count)
    ..sink("add", (b) => b.add);

  await cli.run();
}
Example ----------------------------------
Streams:
  * [count]: 0


Sinks: [add]
Type '-exit' to quit
----------------------------------------
Type a sink name to send it a value
----------------------------------------

And obviously, each time one of the streams is updated, the view will refresh.

Use this package as a library

1. Depend on it

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


dependencies:
  bloc_cli: ^0.1.3-dev

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

We analyzed this package on Oct 17, 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: Flutter, web, other

No platform restriction found in primary library package:bloc_cli/bloc_cli.dart.

Health suggestions

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

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

line 28 col 10: Don't explicitly initialize variables to null.

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

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

line 6 col 8: Unused import: 'types/list.dart'.

Format lib/bloc_cli.dart.

Run dartfmt to format lib/bloc_cli.dart.

Fix additional 7 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/src/serializers/serializer.dart (Run dartfmt to format lib/src/serializers/serializer.dart.)
  • lib/src/serializers/types/bool.dart (Run dartfmt to format lib/src/serializers/types/bool.dart.)
  • lib/src/serializers/types/int.dart (Run dartfmt to format lib/src/serializers/types/int.dart.)
  • lib/src/serializers/types/list.dart (Run dartfmt to format lib/src/serializers/types/list.dart.)
  • lib/src/serializers/types/null.dart (Run dartfmt to format lib/src/serializers/types/null.dart.)
  • lib/src/serializers/types/string.dart (Run dartfmt to format lib/src/serializers/types/string.dart.)
  • lib/src/serializers/types/void.dart (Run dartfmt to format lib/src/serializers/types/void.dart.)

Maintenance issues and suggestions

Make sure dartdoc successfully runs on your package's source files. (-10 points)

exitCode: 255 stdout: parsing /tmp/pub-dartlang-dartdocAWMANV/pkg/lib/bloc_cli.dart... parsing /dart-sdk/lib/core/core.dart... parsing /dart-sdk/lib/collection/collection.dart... parsing /dart-sdk/lib/internal/internal.dart... parsing /dart-sdk/lib/async/async.dart... parsing /dart-sdk/lib/convert/convert.dart... parsing /dart-sdk/lib/typed_data/typed_data.dart... parsing /dart-sdk/lib/math/math.dart... parsing /dart-sdk/lib/_chrome/dart2js/chrome_dart2js.dart... parsing /dart-sdk/lib/_internal/js_runtime/lib/foreign_helper.dart... parsing /dart-sdk/lib/_internal/js_runtime/lib/shared/embedded_names.dart... parsing /dart-sdk/lib/_internal/js_runtime/lib/js_helper.dart... parsing /dart-sdk/lib/_internal/js_runtime/lib/interceptors.dart... parsing /dart-sdk/lib/_internal/js_runtime/lib/native_typed_data.dart... parsing /dart-sdk/lib/_internal/js_runtime/lib/js_names.dart... parsing /dart-sdk/lib/_internal/js_runtime/lib/rti.dart... parsing /dart-sdk/lib/_internal/js_runtime/lib/shared/recipe_syntax.dart... parsing /dart-sdk/lib/html/html_common/html_common.dart... parsing /dart-sdk/lib/html/dart2js/html_dart2js.dart... parsing /dart-sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart... parsing /dart-sdk/lib/svg/dart2js/svg_dart2js.dart... parsing /dart-sdk/lib/web_audio/dart2js/web_audio_dart2js.dart... parsing /dart-sdk/lib/web_gl/dart2js/web_gl_dart2js.dart... parsing /dart-sdk/lib/web_sql/dart2js/web_sql_dart2js.dart... parsing /dart-sdk/lib/js/dart2js/js_dart2js.dart... parsing /dart-sdk/lib/js/_js.dart... parsing /dart-sdk/lib/mirrors/mirrors.dart... parsing /dart-sdk/lib/html/dartium/nativewrappers.dart... parsing /dart-sdk/lib/html/html_common/metadata.dart... parsing /dart-sdk/lib/developer/developer.dart... parsing /dart-sdk/lib/isolate/isolate.dart... parsing /dart-sdk/lib/ffi/ffi.dart... parsing /dart-sdk/lib/_http/http.dart... parsing /dart-sdk/lib/io/io.dart... parsing /dart-sdk/lib/js_util/dart2js/js_util_dart2js.dart... parsing /dart-sdk/lib/cli/cli.dart... parsing /dart-sdk/lib/_internal/js_runtime/lib/js_primitives.dart... parsing /dart-sdk/lib/_internal/js_runtime/lib/shared/async_await_error_codes.dart... Initialized dartdoc with 38 libraries in 28.3 seconds documenting bloc_cli Generating docs for library bloc_cli from package:bloc_cli/bloc_cli.dart... stderr: Documenting bloc_cli... Unhandled exception: RangeError (start): Invalid value: Only valid value is 0: 1 #0 _StringBase.indexOf (dart:core-patch/string_patch.dart:336:7) #1 String.indexOf (dart:core-patch/string_patch.dart:1028:18) #2 _createLineNumbersMap (package:dartdoc/src/line_number_cache.dart:30:23) #3 LineNumberCache.lineAndColumn.

Provide a file named CHANGELOG.md. (-20 points)

Changelog entries help developers follow the progress of your package. See the example generated by stagehand.

The package description is too short. (-13 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.

Package is pre-release. (-5 points)

Pre-release versions should be used with caution; their API can change in breaking ways.

Maintain an example.

None of the files in the package's example/ directory matches known example patterns.

Common filename patterns include main.dart, example.dart, and bloc_cli.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 <3.0.0
meta ^1.1.7 1.1.7
Dev dependencies
rxdart any