Skip to main content

A code generator for Flutter

Project description

Code generator for Flutter apps

Installation:

Install Python on Mac

$ brew install python3

Install Python on Windows

https://www.python.org/downloads/

Install Tool:

$ pip3 install flutter_gen
Command line #### Update: ``` $ pip3 install -U flutter_gen ``` #### Uninstall: ``` $ pip3 uninstall flutter_gen ```

Generate

1. Generate image class:

$ flutter_gen gen image
📑 Example
const _assetsImagePath = 'assets/images';

class Images {
  static const test = '$_assetsImagePath/test.png';
}

2. Generate localization class:

$ flutter_gen gen localization
📑 Example
class i18n {
  static String get test => 'test'.tr();
}

3. Generate router class:

$ flutter_gen gen router
📑 Example
Future? toHome({int? id}) {}

Future? offAllHome({int? id}) {}

Future? offAndToHome({int? id}) {}

Future? offHome({int? id}) {}

Future? offUntilHome({int? id}) {}

4. Sync:

Run all generate command

$ flutter_gen sync

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flutter_gen-1.0.1.tar.gz (19.8 kB view hashes)

Uploaded Source

Built Distribution

flutter_gen-1.0.1-py3-none-any.whl (30.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page