npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

flutter-generator

v1.0.3

Published

A CLI generator for flutter stateless/stateful widget page, router and bloc

Downloads

31

Readme

flutter-generator

A CLI generator for flutter stateless/stateful widget page, router and bloc.

Install

$ npm install -g flutter-generator

Usage

The most basic command runs a wizard to create a page.

$ dg

Note: Names can be given in any format (slug-case, camelCase, PascalCase, UPPERCASE, lowercase etc.).

stateful widget page

Directly create a component based on the current settings with stateful widget.

$ dg stateful-page <name>

Arguments:

  • name: The name you want to use for the page.

Options:

  • -d, --destination <destination>: Override the destination for component.
  • -p, --template-path <template-path>: Override template path.
  • -t, --template <template>: Override template type. By default it uses the 'pages' folder from the template path. With this option you can use a different template folder.
  • -f, --force: Force creation of a page. By default it's impossible to create a page if the destination path doesn't exist. This option forces the creation of a page and will generates the destination folders if they don't exist.

Examples:

$ dg stateful-page  home-page
$ dg stateful-page  setting-page -d ./my-component/ui
$ dg stateful-page  detail-page -d ./src/widget/players/ -t details -f

The generated file will be

$ home_page.dart

stateless widget page

Directly create a component based on the current settings with stateless widget.

$ dg stateless-page <name>

Arguments:

  • name: The name you want to use for the page.

Options:

  • -d, --destination <destination>: Override the destination for page.
  • -p, --template-path <template-path>: Override template path.
  • -t, --template <template>: Override template type. By default it uses the 'pages' folder from the template path. With this option you can use a different template folder.
  • -f, --force: Force creation of a page. By default it's impossible to create a page if the destination path doesn't exist. This option forces the creation of a page and will generates the destination folders if they don't exist.

Examples:

$ dg stateless-page  home-page
$ dg stateless-page  setting-page -d ./my-component/ui
$ dg stateless-page  detail-page -d ./src/widget/players/ -t details -f

The generated file will be

$ home_page.dart

bloc

Directly create a bloc module based on the current settings.

$ dg bloc <name>

Arguments:

name: The name you want to use for the bloc module. Options:

  • -d, --destination <destination>: Override the destination for bloc module.
  • -p, --template-path <template-path>: Override template path.
  • -t, --template <template>: Override template type. By default it uses the 'bloc' folder from the template path. With this option you can use a different template folder.
  • -f, --force: Force creation of a bloc. By default it's impossible to create a bloc if the destination path doesn't exist. This option forces the creation of a bloc and will generates the destination folders if they don't exist.

Examples:

$ dg bloc user
$ dg bloc shopping-cart -d ./modules
$ dg bloc Car -t bloc

The generated file will be

$ name_bloc.dart

settings

Set or display settings. Without any options it will display the settings. By default it will set the settings locally in a .fluttergenerator file. You can also set global settings by using the global option -g --global.

$ dg settings

Options:

  • -v, --view-destination <destination>: Set default view destination.
  • -c, --component-destination <destination>: Set default component destination.
  • -s, --store-destination <destination>: Set default store destination.
  • -t, --template-path <template-path>: Set template path.
  • -l, --log: Log global or local settings depending on the global flag.
  • -g, --global: Set global settings.

Examples:

$ dg settings -l
$ dg settings -v ./view -c ./widgets -s ./models/store -t ./template
$ dg settings -g -c ./widgets

reset

Reset global settings to the defaults.

$ dg reset

show-templates

Open the default template directory. The default templates can be edited to fit your needs.

$ dg show-templates

copy-templates

Copy the default templates to another directory. This is handy when you want to customize the default templates. Don't forget to run dg init or set the template path with dg settings.

$ dg copy-templates