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
Release history Release notifications | RSS feed
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.0.tar.gz
(19.8 kB
view hashes)
Built Distribution
Close
Hashes for flutter_gen-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0cbcff8506ca94578e7b07a350dab9a2f370c362571bd0f9ee68e132d0397353 |
|
MD5 | b0808d712432457e4b3059216f340c53 |
|
BLAKE2b-256 | 164f5ef9708451befa33e96e711e1b2f28cf6f76c0b9a096e79f3e60b61d4875 |