Introduction
A command-line tool that simplifies auto-code generation. Fully flexible, allowing you to generate a feature and widget for your Flutter applications.
Features
- Feature code generation (Basic structure with classes)
- Widget code generation
Flutter Compatibility
Package version | Dart version | Flutter version | Boilerplate version |
---|---|---|---|
0.0.3 | 3.2.6 | 3.16.0 - 3.19.3 | 1.0.0 |
0.0.2 | 3.2.6 | 3.16.0 - 3.19.3 | 1.0.0 |
Getting Started
To integrate the package into your Flutter project, follow these steps:
Add Dependency
Add the following dependency to your pubspec.yaml file:
dependencies:
jt_flutter_cli: ^0.0.3
Then run:
flutter pub get
dart pub global activate jt_flutter_cli
Usage
create new feature:
jt_flutter_cli create feature {name_of_feature}
In the above configuration, the package is creating a new feature that is available in the lib/feature/name_of_feature path. It will generate the name_of_feature folder, which has the dart files and the domain, presentation, and data folders as shown below.
.
├── ...
├── name_of_feature
│ ├── data
│ │ ├── data_source
│ │ │ └── name_of_feature_data_source.dart
│ │ │ └── name_of_feature_data_source_impl.dart
│ │ ├── repository
│ │ │ └── name_of_feature_repo_impl.dart
│ │ │ └── mock_name_of_feature_repo_impl.dart
│ ├── domain
│ │ ├── repositories
│ │ │ └── name_of_feature_repo.dart
│ ├── presentation
│ │ ├── bloc
│ │ │ └── name_of_feature_bloc.dart
│ │ │ └── name_of_feature_data_event.dart
│ │ │ └── name_of_feature_data_state.dart
│ │ ├── screen
│ │ │ └── name_of_feature_screen.dart
│ │ └── name_of_feature_page.dart
└── ...
create new widget:
jt_flutter_cli create widget {name_of_widget}
It will prompt the user with the following question: "Do you want to create a common widget or a feature widget? (common/feature)". If the user selects "common", the widget will be created inside the folder lib/core/ui/widgets. Alternatively, if the user selects "feature", it will prompt the user to enter the feature name, and the widget will be created inside the respective feature's folder at lib/feature/name_of_feature/presentation/screen/widgets.
Add GET API call:
jt_flutter_cli Add get-api-call {API_end_point} {API_name}
Libraries
- add_api_call/api_call_cli
- create_feature/basic_structure/presentation/bloc/basic_structure_bloc
- create_feature/basic_structure/data/data_source/basic_structure_data_source
- create_feature/basic_structure/data/data_source/basic_structure_data_source_impl
- create_feature/basic_structure/presentation/bloc/basic_structure_event
- create_feature/basic_structure/basic_structure_page
- create_feature/basic_structure/domain/repositories/basic_structure_repo
- create_feature/basic_structure/data/repository/basic_structure_repo_impl
- create_feature/basic_structure/presentation/screen/basic_structure_screen
- create_feature/basic_structure/presentation/bloc/basic_structure_state
- add_api_call/usecases/basic_structure_usecase
- create_widget/basic_widget/basic_widget
- create_feature/create_feature_cli
- create_model/create_model_cli
- create_widget/create_widget_cli
- core/package/json_ast/error
- create_model/utils/helpers
- core/package/json_ast/json_ast
- jt_flutter_cli
- core/package/json_ast/location
- create_feature/basic_structure/data/repository/mock_basic_structure_repo_impl
- create_model/utils/model_generator
- core/package/json_ast/parse
- core/package/json_ast/parse_error_types
- core/package/json_ast/utils/substring
- create_model/utils/syntax
- core/package/json_ast/tokenize
- core/package/json_ast/tokenize_error_types
- util/utilities