Skip to content

Instantly share code, notes, and snippets.

@sgr-ksmt
Created November 6, 2020 13:15
Show Gist options
  • Save sgr-ksmt/d32c0530d63d77f2cec00bfb3773e903 to your computer and use it in GitHub Desktop.
Save sgr-ksmt/d32c0530d63d77f2cec00bfb3773e903 to your computer and use it in GitHub Desktop.
VSCode Snippet: river_pod provider template
{
"prvdr": {
"prefix": "prvdr",
"body": [
"import 'package:hooks_riverpod/hooks_riverpod.dart';",
"final ${1:${TM_FILENAME_BASE/((^[a-z])|_([a-z]))/${2:/downcase}${3:/upcase}/g}} = Provider$2((ref) => ${TM_FILENAME_BASE/((^[a-z])|_([a-z]))/${2:/upcase}${3:/upcase}/g}(ref.read));",
"",
"class ${TM_FILENAME_BASE/((^[a-z])|_([a-z]))/${2:/upcase}${3:/upcase}/g} {",
" const ${TM_FILENAME_BASE/((^[a-z])|_([a-z]))/${2:/upcase}${3:/upcase}/g}(this._read);",
" final Reader _read;",
"}",
]
}
}
@sgr-ksmt
Copy link
Author

sgr-ksmt commented Nov 6, 2020

Example

Nov-06-2020 22-13-56

Special Thanks

Original: mono0926/live_templates@0024f05

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment