KTools
KTools provides utilities for generating code for assets and translations in your Dart or Flutter project.
Features
- Asset Code Generation: Automatically generates Dart code for your assets, making them easily accessible in your code.
- Translation Code Generation: Generates Dart code for your translations, allowing for easy localization of your application.
- Configurable: Configure ignored assets, ignored languages, input translations, and output paths through the
pubspec.yamlfile.
Usage
First, add KTools to your pubspec.yaml:
dev_dependencies:
ktools: ^1.1.0
Then, run the following command to generate code:
dart run ktools [action]
This will generate Dart code for your assets or translations, which you can then use in your application.
Configuration
You can configure KTools through the pubspec.yaml file. Here is an example configuration:
ktools:
ignore:
assets: ['path/to/ignore']
languages: ['en', 'es']
translations: 'path/to/translations'
output:
assets: 'lib/gen/assets.g.dart'
translations: 'lib/gen/translations.g.dart'
In this configuration:
ignore.assetsis a list of asset paths to ignore.ignore.languagesis a list of language codes to ignore in translations.translations isthe path to the translations directory.output.assetsis the path to the generated assets Dart file.output.translationsis the path to the generated translations Dart file.
Contributing
Contributions are welcome! Please open an issue or submit a pull request on GitHub.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Libraries
- ktools
- A library for generating Dart code from assets and translations.