Back to Bloc

README

packages/bloc_tools/README.md

latest4.4 KB
Original Source
<p align="center"> </p> <p align="center"> <a href="https://pub.dev/packages/bloc_tools"></a> <a href="https://github.com/felangel/bloc/actions"></a> <a href="https://codecov.io/gh/felangel/bloc"></a> <a href="https://github.com/felangel/bloc"></a> <a href="https://pub.dev/packages/bloc_lint"></a> <a href="https://flutter.dev/docs/development/data-and-backend/state-mgmt/options#bloc--rx"></a> <a href="https://github.com/Solido/awesome-flutter#standard"></a> <a href="https://fluttersamples.com"></a> <a href="https://opensource.org/licenses/MIT"></a> <a href="https://discord.gg/bloc"></a> <a href="https://github.com/felangel/bloc"></a> </p>

Tools for building applications using the bloc state management library.

Sponsors

Our top sponsors are shown below! [Become a Sponsor]

<table style="background-color: white; border: 1px solid black"> <tbody> <tr> <td align="center" style="border: 1px solid black"> <a href="https://shorebird.dev"></a> </td> <td align="center" style="border: 1px solid black"> <a href="https://getstream.io/chat/flutter/tutorial/?utm_source=Github&utm_medium=Github_Repo_Content_Ad&utm_content=Developer&utm_campaign=Github_Jan2022_FlutterChat&utm_term=bloc"></a> </td> <td align="center" style="border: 1px solid black"> <a href="https://rettelgame.com/"></a> </td> </tr> </tbody> </table>

Installing

sh
dart pub global activate bloc_tools

Commands

$ bloc lint [files...]

Analyze Dart source code using the official bloc linter to improve code quality and enforce consistency.

Usage

sh
# Lint the current directory
bloc lint .

# Lint multiple files
bloc lint ./path/to/bloc.dart ./path/to/cubit.dart

Check out the official documentation for information.

$ bloc new [component]

Create new bloc/cubit components from various templates.

Usage

sh
# Create a CounterBloc
bloc new bloc --name counter

# Create a CounterCubit
bloc new cubit --name counter

Components

ComponentDescription
blocGenerate a new Bloc
cubitGenerate a new Cubit
hydrated_blocGenerate a new HydratedBloc
hydrated_cubitGenerate a new HydratedCubit
replay_blocGenerate a new ReplayBloc
replay_cubitGenerate a new ReplayCubit

Usage

sh
Command Line Tools for the Bloc Library.

Usage: bloc <command> [arguments]

Global options:
-h, --help       Print this usage information.
    --version    Print the current version.

Available commands:
  lint   bloc lint [arguments]
         Lint Dart source code.
  new    bloc new <subcommand> [arguments]
         Generate new bloc components.

Run "bloc help <command>" for more information about a command.