Extended Functionality of Cubit: New Cubit :
Use _get with the cubit name to get extra code for HTTP get request
User _post with the cubit name to get extra code for HTTP post request
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.
Code Actions
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
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
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
bloctest
Creates a blocTest
Freezed Bloc
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