VSCode support for the Bloc Library and provides tools for effectively creating Blocs and Cubits for both Flutter and AngularDart apps.
Bloc can be installed from the VSCode Marketplace or by searching within VSCode.
Command |
Description |
Bloc: New Bloc |
Generate a new Bloc |
Cubit: New Cubit |
Generate a new Cubit |
You can activate the commands by launching the command palette (View -> Command Palette) and running entering the command name or you can right click on the directory in which you'd like to create the bloc/cubit and select the command from the context menu.
Action |
Description |
Wrap with BlocBuilder |
Wraps current widget in a BlocBuilder |
Wrap with BlocListener |
Wraps current widget in a BlocListener |
Wrap with BlocConsumer |
Wraps current widget in a BlocConsumer |
Wrap with BlocProvider |
Wraps current widget in a BlocProvider |
Wrap with RepositoryProvider |
Wraps current widget in a RepositoryProvider |
Shortcut |
Description |
bloc |
Creates a Bloc class |
cubit |
Creates a Cubit class |
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 |
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 |
Shortcut |
Description |
feventwhen |
Creates a map event to state function with freeze.when function |
feventmap |
Creates a map event to state function with freeze.map function |
fstate |
Creates a sub state |
fevent |
Creates a sub event |