Skip to content
| Marketplace
Sign in
Visual Studio Code>Snippets>Flutter SnippetsNew to Visual Studio Code? Get it now.
Flutter Snippets

Flutter Snippets

jdebecka

|
4,630 installs
| (1) | Free
Collection of Flutter snippets used on a day to day basis by Flutter developers working commercially.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Flutter Snippets

Flutter Snippet extension will allow you code and test your Flutter/Dart projects faster. There are multiple test snippets as well as Widget oriented ones.

Acknowledgement

This extension was created in collaboration w/ @korzonkiee

Dependencies

Flutter

  • Bloc
  • Mocktail
  • Flutter Widgets
  • Flutter Testing

Dart

  • Object Models
  • Comments
  • Object Model Testing
  • json_serializable
  • equatable

| Shortcut | Description | | ------------------- | ------------------------------------------------------------------- | | jsonMethods | Creates factory fromJson and toJson to use with JsonSerializable. | serializableObject | Creates JsonSerializable object class extending Equatable w/ fromJson, toJson and copyWith() method pre-defined. | | jsonMethodsWithComments | Create factory fromJson and toJson to use with JsonSerializable with comments. | | docTempl | Creates macro for the document template. | | macroComment | Creates class comment using macro. | | mock | Creates Mock for a class. Used in testing w/ Mocktail. | | whenThenAnswer | Creates when method followed by thenAnswer. Used in testing w/ Mocktail. | | whenThenThrow | Creates when method followed by thenThrow. Used in testing w/ Mocktail. | | whenThenReturn | Creates when method followed by thenReturn. Used in testing w/ Mocktail. | | fakeClass | Creates class extending Fake. Used in testing. | | fakeStateEvent | Creates class for Bloc/Cubit state, and Bloc event extending Fake. Used in testing. | | pageViewProvider | Page w/ View where Bloc is propagated down. Includes route. | | pageView | Page w/ View. Includes route. | | classProperty | Property of the class w/ comment. | | propertycomment | Comment w/ an example. | | emptyObject | Empty object for a model. | | objectModelTest | Creates test for an object model. | | materialPage | Creates Material page. | | materialRoute | Creates Material page route. | | fadeTransitionPage | Creates Material page w/ a fade transition. | | statelessWidget | Creates Flutter Statless Widget. | | statefulWidget | Creates Flutter Stateful Widget. |

Preview

CleanShot 2022-03-21 at 8 07 00

CleanShot 2022-03-21 at 8 08 56

CleanShot 2022-03-21 at 8 10 14

CleanShot 2022-03-21 at 8 11 06

CleanShot 2022-05-10 at 10 10 03

CleanShot 2022-05-10 at 10 08 04

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft