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.1.tar.gz
(19.8 kB
view hashes)
Built Distribution
Close
Hashes for flutter_gen-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa0340d130ce93ba9d9ba76ec863f29d099d6ec20f8bea5f7cebb96b40d4d3d2 |
|
MD5 | 6927ef39af2a81d41779b76fac09a924 |
|
BLAKE2b-256 | 1f4e6d88718f8c8e2dcd970a956b9b3b8abfc9bca7f920ac211fce5251015165 |