module_generator 0.0.2 copy "module_generator: ^0.0.2" to clipboard
module_generator: ^0.0.2 copied to clipboard

CLI untuk generate module GetX (controller, page, binding, routes, pages).

module_generator #

pub package

module_generator is a simple CLI tool to generate GetX modules (Controller, Page, Binding, Routes, and Pages) automatically.
With just one command, you get a clean folder structure and boilerplate code ✅.


✨ Features #

  • Generate a complete GetX module (Controller, Page, Binding, Index).
  • Automatically updates:
    • import_all.dart
    • getx/routes.dart
    • getx/pages.dart
  • Keeps your project structure clean and consistent.
  • Usable directly from the terminal.

📦 Installation #

Global activation #

Activate the package globally:

dart pub global activate module_generator

Make sure the pub cache bin directory is in your PATH:

  • Linux / macOS
    Add this line to your ~/.bashrc or ~/.zshrc:

    export PATH="$PATH":"$HOME/.pub-cache/bin"
    
  • Windows (PowerShell)
    Add this line to your $PROFILE:

    $env:Path += ";$env:APPDATA\Pub\Cache\bin"
    

Verify the installation:

module_generator --help

🚀 Usage #

Generate a new module #

module_generator <moduleName> <ROUTE_NAME> </routePath>

Example:

module_generator home HOME /home

This will create:

lib/
 └─ modules/
     └─ home/
         ├─ home_controller.dart
         ├─ home_page.dart
         ├─ home_binding.dart
         └─ home.dart

Additionally:

  • lib/import_all.dart → automatically updated with module export
  • lib/getx/routes.dart → automatically updated with the new route
  • lib/getx/pages.dart → automatically updated with a new GetPage entry

📂 Example Output #

home_controller.dart

import 'package:android/import_all.dart';

class HomeController extends GetxController {
  // TODO: Implement HomeController
}

home_page.dart

import 'package:android/import_all.dart';

class HomePage extends GetView<HomeController> {
  const HomePage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('Home')),
      body: const Center(child: Text('Home View')),
    );
  }
}

🛠️ Development #

Clone this repository:

git clone https://github.com/abhu66/module_generator.git
cd module_generator

Activate locally:

dart pub global activate --source path .

Test:

module_generator test TEST /test

Support the Project #

If you find this plugin helpful, consider supporting its development:

  • Buy Me a Coffee

Your support is greatly appreciated!

📄 License #

MIT License. See the LICENSE file for details.

1
likes
135
points
207
downloads

Publisher

unverified uploader

Weekly Downloads

CLI untuk generate module GetX (controller, page, binding, routes, pages).

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

path

More

Packages that depend on module_generator