Skip to content
| Marketplace
Sign in
Visual Studio Code>Snippets>Bloc HeimNew to Visual Studio Code? Get it now.
Bloc Heim

Bloc Heim

Emin Chernov

|
918 installs
| (1) | Free
VSCode extension which drastically reduces bloc-related boilerplate code for Flutter projects.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Bloc Heim

VSCode extension which drastically reduces bloc-related boilerplate code for Flutter projects.

Features

Command bloc-heim.createBloc for equatable-based bloc template, which includes:

  • Main bloc file.
  • Bloc state file — one class with status field, with respect to official bloc naming convention.
  • Bloc events file.

Command and code action bloc-heim.addStateProperty:

  • Adds a new property snippet to bloc state class.
  • Works only for status-based state classes.

Wrappers and code-actions for all bloc Flutter widgets:

  • BlocProvider: bloc-heim.wrapWithBlocProvider
  • MultiBlocProvider: bloc-heim.wrapWithMultiBlocProvider
  • BlocBuilder: bloc-heim.wrapWithBlocBuilder
  • BlocSelector: bloc-heim.wrapWithBlocSelector
  • BlocListener: bloc-heim.wrapWithBlocListener
  • MultiBlocListener: bloc-heim.wrapWithMultiBlocListener
  • BlocConsumer: bloc-heim.wrapWithBlocConsumer
  • RepositoryProvider: bloc-heim.wrapWithRepositoryProvider
  • MultiRepositoryProvider: bloc-heim.wrapWithMultiRepositoryProvider

Snippets:

  • blocevent - generates new bloc event class with placeholders.
  • onblocevent - generates code for bloc`s event handler.
  • emitblocstate - generates bloc`s emit code with state.copyWith included.
  • readbloc - generates code which reads bloc from context.
  • readblocadd - generates code which reads bloc from context and adds bloc event.

Usage

Creating a bloc

  • You can create a new bloc with bloc-heim.createBloc command in the Command Palette.
  • Also, you can right-click on a folder in the file explorer and then select "Bloc Heim: Create Bloc" item.

Adding a new state property

  • Place a cursor within a state class and execute 'Add bloc state property' from Command Palette.
  • Adding a new property from code actions is also available.

Wrapping a code with Bloc widgets

  • Place cursor on a code (widget) you want to be wrapped with a Bloc Widget.
  • Open code actions context menu: run a Quick Fix or Refactor command.
  • Select a command which you want to use (Wrap with BlocBuilder, Wrap with BlocProvider etc.)
  • Type bloc's name and state placeholders.

Requirements

  • flutter_bloc ^8.0.0
  • equatable ^2.0.0
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft