StatelessWidget with filename

StatelessWidget with filename

VSCode snippet - The improved statelessW snippet

Demo fo the stlsnamed snippet
  1. Create a snippet file for your project or add it to your global VSCode snippets
  2. For project specific create the file: .vscode/*.code-snippets
  3. Add the code below inside of some curly brackets {}
  4. Then type stlsnamed to add the snippet
"StatelessWidget with filename": {
  "prefix": [
    "stlsnamed"
  ],
  "body": [
    "import 'package:flutter/material.dart';",
    "",
    "class ${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/g} extends StatelessWidget {",
    "  const ${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/g}({super.key});",
    "",
    "  @override",
    "  Widget build(BuildContext context) {",
    "    return ${1:Container()};",
    "  }",
    "}",
    ""
  ],
  "description": "Creates StatelessWidget which shares the name of the file"
},