import 'dart:developer';
simpler-flutter-snippets README
Snippets for Flutter
Wrappers for Flutter
A set of helpful Flutter and Dart Snippets for day to day Flutter development.
Installation
Features
Simply Flutter / Dart Snippets
I'm working hard to select all the day to day widgets, so wait for more Snippets!.
Snippet Widgets |
Description |
|
|
stateFullWidget --> |
StatefulWidget() |
|
|
stateLessWidget --> |
StatelessWidget() |
|
|
caaaaaa --> |
crossAxisAlignment: CrossAxisAlignment.choice, |
|
|
maaaaaa --> |
mainAxisAlignment: MainAxisAlignment.choice, |
|
|
mainAxi --> |
mainAxisSize: MainAxisSize.min |
|
|
ftxt --> |
Text() |
|
|
frxr --> |
Text.rich() |
|
|
fstyle --> |
TextStyle() |
|
|
1xHeight --> |
const SizedBox(height: action), |
|
|
1xWidth --> |
const SizedBox(width: action), |
|
|
1xx --> |
const SizedBox(width: 10, height: 10,), |
|
|
SizedBox --> |
const SizedBox.choice |
|
|
fic --> |
const Icon(Icons.clear); |
|
|
ficbtn --> |
const IconButton() |
|
|
fcontainer --> |
Container() |
|
|
fsaffold --> |
Scaffold() |
|
|
listViewB --> |
ListView.builder() |
|
|
listViewS --> |
ListView.separated() |
|
|
gridViewB --> |
GridView.builder() |
|
|
gridViewC --> |
GridView.count() |
|
|
pageViewB --> |
PageView.builder() |
|
|
padding --> |
choice: const EdgeInsets.all(10), |
|
|
fedgeAll --> |
EdgeInsets.all(32.0) |
|
|
fedgeOnly --> |
const EdgeInsets.only() |
|
|
fedgSym --> |
const EdgeInsets.symmetric(vertical: 8, horizontal: 8,), |
|
|
felebtn --> |
ElevatedButton() |
|
|
fimg --> |
Image.[choice |
assets,network |
]; |
borderCircular --> |
borderRadius: BorderRadius.circular(action), |
|
|
borderAll --> |
borderRadius: BorderRadius.all(Radius.circular(action)), |
|
|
fshowDialog --> |
showDialog() |
|
|
frow --> |
Row |
|
|
fcol --> |
Column |
|
|
flist --> |
List listName = []; |
|
|
fcolorHax --> |
Color(0xFF9C27B0), |
|
|
fvalueNotifier --> |
ValueNotifier customValue = ValueNotifier(false); |
|
|
fanimatedBuilder --> |
late Animation animations; |
|
|
fvariable --> |
Just Variables |
|
|
fmap --> |
Map<dynamic, dynamic> mapName = {}; |
|
|
fset --> |
Set setName = {}; |
|
|
fgetarr --> |
dynamic get name => returnValue; |
|
|
fsettarr --> |
set name(dynamic value) => some = value; |
|
|
ff --> |
|
|
|
Snippet Cycles |
Description |
flifeInit --> |
InitState() |
flifeDispose --> |
Dispose() |
flifeReassemble --> |
Reassemble() |
flifeDidChangeD --> |
DidChangeD() |
flifeDidUpdateW --> |
DidUpdateW() |
flifeDiActivate --> |
DiActivate() |
flifeCycle --> |
Cycle() |
Snippet Widgets |
Description |
fnav material --> |
Navigator.push() material |
fnav cupertino --> |
Navigator.push() cupertino |
mateApp --> |
MaterialApp() |
cupeApp --> |
CupertinoApp() |
fsvg --> |
SvgPicture.asset() |
flocale --> |
LocaleKeys..tr(),() |
dddddddddddddddddLog ---> |
log('data: choice') |
usecase --> |
usecases() |
fcontroller --> |
controller() |
context --> read |
context.read<>().add(); |
context --> router |
context.router.push(); |
fgetttttt --> |
GetIt.I<>()..add() |
toStr --> |
toString() |
fSimplerFlutterReCase --> |
just cases() |
futureFunc --> |
Future |
freezed --> |
freezed model |
fhiveModel --> |
hive model |
deleted in version 0.1.9
| trrrrr Repo -->
| try - repo() |
| trrrrr Simple -->
| try - simple() |
| trrrrr Pro -->
| try - dop() |
| repo -->
| repository() |
| into -->
| interactor() |
Wrappers Widgets |
Description |
visibility on Menu |
Wrap with Value Listenable |
ValueListenableBuilder |
[default] - true |
Wrap with Cubit/Bloc Builder |
Cubit/Bloc Builder |
[default] - false |
Wrap with Cubit/Bloc Consumer |
Cubit/Bloc Consumer |
[default] - false |
Wrap with Stack Widget |
Stack |
[default] - true |
Wrap with Future Builder |
FutureBuilder |
[default] - false |
Wrap with StateFullBuilder |
StateFullBuilder |
[default] - false |
Wrap with Tween Builder |
Tween Builder |
[default] - false |
Wrap with AnimatedBuilder |
AnimatedBuilder |
[default] - false |
Wrap with StreamBuilder |
StreamBuilder |
[default] - false |
Wrap with SingleChildScroll |
SingleChildScrollViewBuilder |
[default] - false |
Wrap with Expanded |
Expanded |
[default] - false |
Wrap with Flexible |
Flexible |
[default] - false |
Wrap with FittedBox |
FittedBox |
[default] - false |
Imports |
Description |
fimport --> MaterialApp |
import Material App |
fimport --> CupertinoApp |
import Cupertino App |
fimport --> Provider |
import Provider |
fimport --> Locale |
import Locale |
fimport --> autRoute g |
import autRoute g |
fimport --> flutter bloc |
import flutter bloc |
fimport --> equatable |
import equatable |
fimport --> injectable |
import injectable |
--------------------------------- |
-------------------------------------------------------------- |
Flutter just logger
Logger Type |
Description |
from Clipboard Logger |
log(data-unique: ${ from clipboard } ) |
only Interpolation Logger |
log(data-unique: ${ } ) - with only interpolation |
simple Logger |
log(data:) - simple |
Wrappers
"SimplerFlutterSnippets.WrapperOnMenu": "show",
"SimplerFlutterSnippets.FutureBuilder": true,
"SimplerFlutterSnippets.ValueListenableBuilder": true,
"SimplerFlutterSnippets.StateFullBuilder": true,
"SimplerFlutterSnippets.TweenBuilder": true,
"SimplerFlutterSnippets.StreamBuilder": true,
"SimplerFlutterSnippets.SingleChildScrollViewBuilder": true,
"SimplerFlutterSnippets.AnimatedBuilder": true,
"SimplerFlutterSnippets.CubitBuilder": true,
"SimplerFlutterSnippets.CubitConsumer": true,
"SimplerFlutterSnippets.WrapperStack": true,
"SimplerFlutterSnippets.removeThisWidget": true,
"SimplerFlutterSnippets.selectedImport": true,
"SimplerFlutterSnippets.TypeLogger": "from Clipboard Logger"
SimplerFlutterSnippets.TypeLogger
- working only on keyShorts snippets.customLogger
About auto Imports and auto Quick Fix
"SimplerFlutterSnippets.selectedImport": true,
"SimplerFlutterSnippets.autoFix": true,
"SimplerFlutterSnippets.FlutterImports": {
"targetFileTypes": [
"dart"
],
"importMappings": [
{
"imports": [
"import 'package:freezed_annotation/freezed_annotation.dart';"
],
"keys": [
"freezed"
]
},
{
"imports": [
"import 'package:flutter/material.dart';"
],
"keys": [
"StatefulWidget",
"StatelessWidget"
]
}
]
},
-- FYI
keybindings
snippets.customLogger - [command + shift + q]
snippets.expanded - [command + shift + e]
snippets.flexible - [command + shift + f]
snippets.emptyWidgetWrap - [command + shift + w]
snippets.rowColumn - [command + shift + c]
snippets.toggleAutoFix - [command + shift + x] - true/false
snippets.removeThisWidget - [command + shift + r]
snippets.singleChildScrollView - [command + shift + s]
ValueNotifierBuilder - [command + shift + v]
Release Notes
0.2.8
- added new snippets class -->
0.2.7
- Fixed the cursor that moved down after the wrapper
0.2.6
- added toggle Auto Fix to apply quick fixers
- snippets.toggleAutoFix - keybinding [command + shift + x]
- deleted auto format
- added new key bind snippets
- snippets.emptyWidgetWrap - keybinding [command + shift + w]
- snippets.rowColumn - keybinding [command + shift + c]
0.2.5
- updated auto IMPORTS when clicking the Widget
- added new feature selecting auto quick fix
- SimplerFlutterSnippets.selectedImport: true
- SimplerFlutterSnippets.autoFix: true
- SimplerFlutterSnippets.FlutterImports: {
- targetFileTypes: ["dart"]
- importMappings: [
{
"imports": [
"import 'package:freezed_annotation/freezed_annotation.dart';"
],
"keys": [
"freezed"
]
},
]
}
0.2.4
- added auto IMPORTS when clicking the Widget
- SimplerFlutterSnippets.selectedImport = true [restart the vs code]
- BlocProvider
- BlocListener
- BlocBuilder
- BlocSelector
- BlocConsumer
- RepositoryProvider
- read
- freezed
- GetIt
- HiveType
- LocaleKeys
- tr
- AutoRouter
- router
- singleton
- injectable
- LazySingleton
- Singleton
- Injectable
- Equatable
- log
0.2.0-0.2.3 (Fixing bugs)
- little release
- added keybinding remove this widget
- mac cmd+shift+r
- winda ctrl+shift+r
0.1.9
- added new Wrappers with auto imports
- Stack
- Cubit/Bloc Builder
- Cubit/Bloc Consumer
- to snippet "listViewS" add default SIzedBox
0.1.8
- fixed increment the logger
0.1.7
- frxr -> Text.rich()
- wrapeers command + shift + e ->
- expanded,
- flexible,
- fittedBox
- wrapper command + shift + s
- SingleChildScrollView
- Padding
- fhiveModel - hive Model
- fnav cupertino - Navigator - Cupertino
- changed Log'a String to data-unique
0.1.5
- Changed Log's String -> data to
0.1.4
- Bug Fixed
- Optimized The Extension
0.1.3
0.1.0
- added logger
- snippets.customLogger add keybinding
0.0.8
Wrappers
- StateFullBuilder
- AnimatedBuilder
- StreamBuilder
- SingleChildScrollViewBuilder
Snippets
- fvalueNotifier
- freezed
- frow
- fcol
- flist
- fcolorHax
- fvalueNotifier
- fanimatedBuilder
- fvariable
- fmap
- fset
- fgetarr
- fsettarr
- ff
0.0.7
Tween Builder
hide / show
0.0.3-4-6
- wrappers
- ValueListableBuilder
- FutureBuilder
0.0.2
0.0.1
Initial release
Enjoy!