get_cli5 0.1.0
get_cli5: ^0.1.0 copied to clipboard
Unofficial CLI for GetX5. Generates initial project structure, views, routes, and services.
Unofficial CLI for the GetX5.
This is the fork of get_cli version 1.9.1.
Changes
The following changes has been made:
-
get_cli5 installs GetX version 5.0.0-release-candidate-9.3.2 (The latest release candidate at the moment) instead of latest stable version (4.7.2). Since the caret syntax doesn't work with RC versions, in case new version will be available in the future, manual fix will be required in pubspec.yaml.
-
Removed dialog that enabled choosing between GetXPattern (MVVM) and Clean. Now it is always GetXPattern.
-
Folder
modulesrenamed topresentationto better follow MVVM naming convention. Instead oflib\ app\ data\ modules\we have
lib\ app\ data\ presentation\ -
Removed
sub_folder: falsepubspec.yaml option. Now it is the flat structure by default:
home\
home_binding.dart
home_controller.dart
home_view.dart
without option for extra folders.
-
Template for Binding class updated to suit GetX5. Now instead of:
class HomeBinding extends Bindings { @override void dependencies() { Get.lazyPut<HomeController>( () => HomeController(), ); } }Will be generated:
class HomeBinding extends Binding { @override List<Bind> dependencies() { return [ Bind.put<HomeController>( HomeController(), ) ]; } } -
Added
create servicecommand. (Read below.)
Installation
First deactivate get_cli (if it has been activated)
dart pub global deactivate get_cli
then activate get_cli5
dart pub global activate get_cli5
Usage
-
Init project
Create Flutter project using View->Command Pallete... or by running
flutter createin terminal. Runget initcommand in terminal It will generate following folders and files
-
Add a view to the project
The command get create page:settings will generate folder settings inside the presentation folder.

Also routes inside the routes folder will be updated.
In case the desired name is "game settings" use get create page:game-settings command.
- Add a service to the project
To create the
AuthServiceindatafolder useget create service:authcommand. It will generateauth_service.dartfile with factory singleton.
class AuthService {
AuthService._();
static final _instance = AuthService._();
factory AuthService() {
return _instance;
}
}
To create the AuthService in data/auth folder use get create service:auth on auth command. If the auth folder does not exist, it will be created.
For more information about other commands of get_cli check official get_cli documentation..