bloc_cli 0.1.3-dev

  • README.md
  • Installing
  • Versions
  • 40

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 packages get

Alternatively, your editor might support pub get or flutter packages 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';
  
Version Uploaded Documentation Archive
0.1.3-dev Jan 16, 2019 Go to the documentation of bloc_cli 0.1.3-dev Download bloc_cli 0.1.3-dev archive
0.1.2-dev Jan 16, 2019 Go to the documentation of bloc_cli 0.1.2-dev Download bloc_cli 0.1.2-dev archive
0.1.1-dev Jan 16, 2019 Go to the documentation of bloc_cli 0.1.1-dev Download bloc_cli 0.1.1-dev archive
0.1.0-dev Jan 16, 2019 Go to the documentation of bloc_cli 0.1.0-dev Download bloc_cli 0.1.0-dev archive
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 Feb 20, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.13+1

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-dartdocSHNFZA/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/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/_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 35 libraries in 32.4 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/runtime/libstring_patch.dart:334:7) #1 String.indexOf (dart:core/runtime/libstring_patch.dart:1024:18) #2 _createLineNumbersMap (package:dartdoc/src/line_number_cache.dart:30:23) #3 LineNumberCache.lineAndColumn.<anonymous closure> (package:dartdoc/src/line_number_cache.dart:47:21) #4 __InternalLinkedHashMap&_HashVMBase&MapMixin&_LinkedHashMapMixin.putIfAbsent (dart:collection/runtime/libcompact_hash.dart:281:23) #5 LineNumberCache.lineAndColumn (package:dartdoc/src/line_number_cache.dart:46:32) #6 ModelElement.lineAndColumn (package:dartdoc/src/model.dart:3499:40) #7 new SourceLinker.fromElement (package:dartdoc/src/source_linker.dart:88:27) #8 ModelElement.sourceHref (package:dartdoc/src/model.dart:3222:25) #9 ModelElement.hasSourceHref (package:dartdoc/src/model.dart:3219:29) #10 _LocalInstanceMirror._invokeGetter (dart:mirrors/runtime/libmirrors_impl.dart:329:76) #11 _LocalInstanceMirror.getField (dart:mirrors/runtime/libmirrors_impl.dart:296:20) #12 Renderer._getNamedProperty (package:mustache/src/renderer.dart:245:29) #13 Renderer.resolveValue (package:mustache/src/renderer.dart:212:16) #14 Renderer._renderSection (package:mustache/src/renderer.dart:120:17) #15 Renderer.visitSection (package:mustache/src/renderer.dart:115:7) #16 SectionNode.accept (package:mustache/src/node.dart:63:43) #17 Renderer.render.<anonymous closure> (package:mustache/src/renderer.dart:58:30) #18 List.forEach (dart:core/runtime/libgrowable_array.dart:277:8) #19 Renderer.render (package:mustache/src/renderer.dart:58:13) #20 Renderer.visitPartial (package:mustache/src/renderer.dart:195:16) #21 PartialNode.accept (package:mustache/src/node.dart:81:43) #22 SectionNode.visitChildren.<anonymous closure> (package:mustache/src/node.dart:66:37) #23 List.forEach (dart:core/runtime/libgrowable_array.dart:277:8) #24 SectionNode.visitChildren (package:mustache/src/node.dart:66:14) #25 Renderer._renderWithValue (package:mustache/src/renderer.dart:184:10) #26 Renderer._renderSection (package:mustache/src/renderer.dart:144:7) #27 Renderer.visitSection (package:mustache/src/renderer.dart:115:7) #28 SectionNode.accept (package:mustache/src/node.dart:63:43) #29 Renderer.render.<anonymous closure> (package:mustache/src/renderer.dart:58:30) #30 List.forEach (dart:core/runtime/libgrowable_array.dart:277:8) #31 Renderer.render (package:mustache/src/renderer.dart:58:13) #32 Template.render (package:mustache/src/template.dart:40:14) #33 Template.renderString (package:mustache/src/template.dart:33:5) #34 HtmlGeneratorInstance._build (package:dartdoc/src/html/html_generator_instance.dart:381:31) #35 HtmlGeneratorInstance.generateLibrary (package:dartdoc/src/html/html_generator_instance.dart:269:5) #36 HtmlGeneratorInstance._generateDocs (package:dartdoc/src/html/html_generator_instance.dart:131:9) #37 HtmlGeneratorInstance.generate (package:dartdoc/src/html/html_generator_instance.dart:36:7) <asynchronous suspension> #38 HtmlGenerator.generate (package:dartdoc/src/html/html_generator.dart:108:23) <asynchronous suspension> #39 Dartdoc.generateDocsBase (package:dartdoc/dartdoc.dart:107:25) <asynchronous suspension> #40 Dartdoc.generateDocs (package:dartdoc/dartdoc.dart:134:43) <asynchronous suspension> #41 main (file:///project/pkg/pub_dartdoc/bin/pub_dartdoc.dart:27:17) <asynchronous suspension> #42 _startIsolate.<anonymous closure> (dart:isolate/runtime/libisolate_patch.dart:287:32) #43 _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:171:12)

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