Bloc
Support for the Bloc state management library for Dart and Flutter. Provides snippets and the Bloc language server.
How to install
With Forge Super installed, the button above opens the app on this extension, where you press Install. Nothing is installed until you do.
You can also open the Extensions panel in the app and search for Bloc. The extension's id is bloc.
Don't have Forge Super yet? Download it here.
README
From the extension's repository, written by its authors and not by Mentenaz. See the source.
Overview
Zed support for the Bloc Library providing snippets and the Bloc language server for Dart and Flutter apps.
Installation
Install from the Zed Extensions panel by searching for "Bloc", or install as a dev extension for local development:
- Open Zed
- Open the command palette and run
zed: install dev extension - Select the
extensions/zeddirectory
Language Server
The Bloc language server provides custom diagnostic reporting for bloc-related lint rules. See the official documentation for more information about configuring the linter and supported lint rules.
The language server binary (bloc_tools) is automatically downloaded from GitHub releases.
Snippets
Bloc
| Shortcut | Description |
|---|---|
importbloc | Imports package:bloc |
importflutterbloc | Imports package:flutter_bloc |
importbloctest | Imports package:bloc_test |
bloc | Creates a Bloc class |
cubit | Creates a Cubit class |
onevent | Register a new EventHandler |
_onevent | Define a new EventHandler |
blocobserver | Creates a BlocObserver class |
blocprovider | Creates a BlocProvider widget |
multiblocprovider | Creates a MultiBlocProvider widget |
repoprovider | Creates a RepositoryProvider widget |
multirepoprovider | Creates a MultiRepositoryProvider widget |
blocbuilder | Creates a BlocBuilder widget |
blocselector | Creates a BlocSelector widget |
bloclistener | Creates a BlocListener widget |
multibloclistener | Creates a MultiBlocListener widget |
blocconsumer | Creates a BlocConsumer widget |
blocof | Shortcut for BlocProvider.of() |
repoof | Shortcut for RepositoryProvider.of() |
read | Shortcut for context.read() |
watch | Shortcut for context.watch() |
select | Shortcut for context.select() |
blocstate | Creates a state class |
blocevent | Creates an event class |
bloctest | Creates a blocTest |
mockbloc | Creates a class extending MockBloc |
_mockbloc | Creates a private class extending MockBloc |
mockcubit | Creates a class extending MockCubit |
_mockcubit | Creates a private class extending MockCubit |
fake | Creates a class extending Fake |
_fake | Creates a private class extending Fake |
mock | Creates a class extending Mock |
_mock | Creates a private class extending Mock |
Freezed Bloc
| Shortcut | Description |
|---|---|
fstate | Creates a freezed state |
fevent | Creates a freezed event |