getx_boilerplate_cli 1.0.2 copy "getx_boilerplate_cli: ^1.0.2" to clipboard
getx_boilerplate_cli: ^1.0.2 copied to clipboard

Command-line interface to generate premium Flutter starter boilerplates utilizing GetX and Clean Architecture.

GetX Boilerplate CLI ๐Ÿš€ #

Pub Version License: MIT Flutter GetX

An enterprise-grade, developer-friendly Command-Line Interface (CLI) tool to instantly scaffold a premium Flutter starter template. Built upon Clean Feature-First Architecture, GetX, Centralized Dependency Injection, Singleton Routing, and deeply customizable Premium UI Components.

Instead of manually cloning a repository and performing tedious search-and-replace naming configurations, this CLI automates the entire process in seconds!


โšก Quick Start #

1. Install the CLI Globally #

Activate the CLI tool on your local machine using the Dart SDK package manager:

dart pub global activate getx_boilerplate_cli

Tip

Ensure your system's PATH environment variable includes the Dart SDK pub-cache/bin directory so you can run the command directly from any terminal.

2. Scaffold a New Project #

Run the create command followed by your desired project name (in lowercase with underscores):

getx_boilerplate_cli create my_awesome_app

โš™๏ธ What the CLI Handles Automatically #

When you run the create command, the CLI performs the following tasks:

  • ๐Ÿ“ฅ Repository Cloning: Clones the absolute latest production-ready template from parentroots/getx.
  • ๐Ÿงน Git History Cleanup: Deletes the cloned .git directory so you start with a clean git history for your team.
  • ๐Ÿ”ง Smart Package Renaming: Recursively scans and renames all namespace declarations and imports from getx_template to my_awesome_app (in pubspec.yaml, Dart source files, Android package manifests, Kotlin imports, iOS configurations, and CMake build configurations).
  • ๐Ÿ“‚ Directory Sorting: Renames files and directory packages containing getx_template to match your new project.
  • ๐Ÿ“ฆ Dependency Resolution: Automatically runs flutter pub get inside the generated project directory so it's ready to run immediately.

๐Ÿ—๏ธ Generated Project Architecture #

The generated project is structured using the industry-proven Clean Feature-First Architecture:

lib/
โ”œโ”€โ”€ core/                   # App-wide foundations & configurations
โ”‚   โ”œโ”€โ”€ bindings/           # Centralized global Dependency Injection (FENIX-enabled)
โ”‚   โ”œโ”€โ”€ config/             # App lifecycle observers & configurations
โ”‚   โ”œโ”€โ”€ constants/          # Static app constants (API, storage keys, colors, strings)
โ”‚   โ”œโ”€โ”€ errors/             # Global error handling logic & custom exceptions
โ”‚   โ”œโ”€โ”€ localization/       # Internationalization & translations
โ”‚   โ”œโ”€โ”€ network/            # Singleton HTTP (Dio) and WebSocket Clients
โ”‚   โ”œโ”€โ”€ routing/            # Singleton navigation & routes registration
โ”‚   โ”œโ”€โ”€ theme/              # Curated light/dark theme config, radius, & typography
โ”‚   โ””โ”€โ”€ utils/              # Helper utilities & extensions
โ”‚
โ”œโ”€โ”€ component/              # Globally shared, highly customizable Common UI widgets
โ”‚   โ”œโ”€โ”€ dialogs/            # App dialogs & Common Snackbars
โ”‚   โ”œโ”€โ”€ layout/             # Lists, Grids, Dropdowns, Radios, Scaffolds, and CommonText
โ”‚   โ”œโ”€โ”€ loading/            # Common shimmers, page loaders & loading overlays
โ”‚   โ”œโ”€โ”€ pickers/            # Compressed Multi-Image, Date, Time, and Country pickers
โ”‚   โ””โ”€โ”€ states/             # Empty, Error, Offline, and Retry state views
โ”‚
โ””โ”€โ”€ features/               # Self-contained modules (Domain layers)
    โ””โ”€โ”€ [feature_name]/     # Example: auth, home, profile
        โ”œโ”€โ”€ data/           # Module-specific API integrations & data models
        โ””โ”€โ”€ screen/         # Flattened UI Presentation Layer (View + Controller)

๐ŸŽจ Common Custom Widgets Encyclopedia #

(Note: In the code snippets below, your_project_name represents the custom package name you passed to the CLI)

All widgets are prefix-unified under the Common namespace. They are designed to enforce responsive layouts, dark/light compatibility, and micro-animations.


๐Ÿ“ Category 1: Form Fields, Inputs & Toggles #

1. CommonButton

๐Ÿ’ก Purpose: Custom button supporting Filled, Outlined, and Text styles, leading/trailing icons, and a built-in loading spinner to handle async operations. โš™๏ธ Key Parameters:

Parameter Type Default Description
titleText String Required Text to display on the button.
onTap VoidCallback? null Tap callback. If null, the button is disabled.
isLoading bool false Renders a loading spinner and disables taps.
buttonColor Color? AppColors.primary Background color.
titleColor Color? Colors.white Text color.
buttonRadius double? 12.0 Rounded corners.
buttonWidth double? double.infinity Set custom width bounds.

๐Ÿš€ Usage:

CommonButton(
  titleText: 'Proceed to Checkout',
  isLoading: controller.isSubmitting.value,
  onTap: () => controller.checkout(),
)

2. CommonTextField

๐Ÿ’ก Purpose: Highly customizable input text field component featuring automated password visibility toggles, autofocus, and error border styling. โš™๏ธ Key Parameters:

Parameter Type Default Description
controller TextEditingController? null Text controller.
label String? null Label text shown above.
hint String? null Placeholder hint.
obscureText bool false Hides input text.
prefixIcon IconData? null Leading icon.
validator String? Function(String?)? null Validation logic callback.

๐Ÿš€ Usage:

CommonTextField(
  label: 'Password',
  hint: 'Enter your password',
  obscureText: controller.obscurePassword.value,
  prefixIcon: Icons.lock_outline,
  validator: (val) => val!.length < 6 ? 'Password is too short' : null,
)

3. Pinput (OTP Input Field)

๐Ÿ’ก Purpose: Animated pin entry for OTP/verification screens. Integrates the pinput package with custom theme overrides matching the app's visual system. ๐Ÿš€ Usage:

Pinput(
  length: 6,
  controller: controller.otpController,
  defaultPinTheme: defaultPinTheme,
  focusedPinTheme: focusedPinTheme,
  showCursor: true,
  hapticFeedbackType: HapticFeedbackType.lightImpact,
  keyboardType: TextInputType.number,
)

4. CommonPhoneTextField

๐Ÿ’ก Purpose: Input designed specifically for international mobile numbers. It includes a built-in searchable country dialing-prefix selector bottom sheet. โš™๏ธ Key Parameters:

Parameter Type Default Description
controller TextEditingController Required Phone input controller.
label String 'Phone Number' Outer label descriptor.
initialCountryCode String 'BD' Preselected ISO country code.

๐Ÿš€ Usage:

CommonPhoneTextField(
  controller: controller.phoneController,
  initialCountryCode: 'BD',
)

5. CommonSearchBar

๐Ÿ’ก Purpose: Sleek search panel that manages its own inner controller and includes a one-click trailing "Clear" button. โš™๏ธ Key Parameters:

Parameter Type Default Description
onChanged ValueChanged<String>? null Triggered on character changes.
hintText String 'Search' Input placeholder text.

๐Ÿš€ Usage:

CommonSearchBar(
  hintText: 'Search items...',
  onChanged: (query) => controller.search(query),
)

6. CommonRatingBar

๐Ÿ’ก Purpose: Displays ratings. Supports interactive star-based selection and static, read-only star previews. โš™๏ธ Key Parameters:

Parameter Type Default Description
rating double Required Rating score to display.
onRatingChanged ValueChanged<double>? null Interactive selector callback. If null, becomes read-only.

๐Ÿš€ Usage:

CommonRatingBar(
  rating: controller.rating.value,
  onRatingChanged: (newRating) => controller.submitRating(newRating),
)

7. CommonSwitch

๐Ÿ’ก Purpose: Premium custom toggle switch featuring smooth spring animation and customizable track/thumb sizes. ๐Ÿš€ Usage:

CommonSwitch(
  value: controller.isDarkTheme.value,
  onChanged: (status) => controller.changeTheme(status),
)

8. CommonTabBar

๐Ÿ’ก Purpose: Animated category sliding selector. Built with custom physics, featuring a beautiful sliding background block indicator. ๐Ÿš€ Usage:

CommonTabBar(
  tabs: const ['Ongoing', 'Completed', 'Canceled'],
  selectedIndex: controller.activeTab.value,
  onTabChanged: (index) => controller.switchTab(index),
)

9. CommonDropdown<T>

๐Ÿ’ก Purpose: Highly styled, customizable dropdown selector wrapper with custom layout themes. ๐Ÿš€ Usage:

CommonDropdown<String>(
  hint: "Select Option",
  items: ["Option 1", "Option 2", "Option 3"],
  value: controller.selectedOption.value,
  onChanged: (val) => controller.selectedOption.value = val,
)

10. CommonRadio<T>

๐Ÿ’ก Purpose: Clean custom radio buttons that enforce visual consistency across Android/iOS platforms. ๐Ÿš€ Usage:

CommonRadio<int>(
  value: 1,
  groupValue: controller.selectedRadio.value,
  onChanged: (val) => controller.selectedRadio.value = val,
  label: "Male",
)

๐Ÿ“ Category 2: View Layouts, Scaffold & Typography #

11. CommonScaffold

๐Ÿ’ก Purpose: Multi-device viewport standardizer. Auto-constrains content width for desktop screens and configures safe-areas and uniform edge padding. ๐Ÿš€ Usage:

CommonScaffold(
  appBar: const CommonAppBar(title: 'Settings'),
  body: Column(...),
)

12. CommonAppBar

๐Ÿ’ก Purpose: Unified Top App Bar that automatically shows back-nav arrow buttons based on navigation history. ๐Ÿš€ Usage:

CommonAppBar(
  title: 'Edit Profile',
  showBack: true,
)

13. CommonBottomNavBar

๐Ÿ’ก Purpose: Premium custom floating bottom navigation bar built with backdrop glassmorphism blurs and animated width-expanding page tab indicators. ๐Ÿš€ Usage:

CommonScaffold(
  bottomNavigationBar: const CommonBottomNavBar(),
  body: Obx(() => controller.currentPage),
)

14. CommonDrawer

๐Ÿ’ก Purpose: Modern navigation drawer supporting profile headers, animated item selected indicators, and link redirections. ๐Ÿš€ Usage:

CommonScaffold(
  drawer: const CommonDrawer(),
  body: MainContentWidget(),
)

15. CommonText

๐Ÿ’ก Purpose: Typography standardization widget. Enforces standard Flutter TextStyle styling, font sizing, font weights, and light/dark theme color scaling. ๐Ÿš€ Usage:

CommonText(
  'User Account Staged',
  style: context.textTheme.headlineMedium,
  fontWeight: FontWeight.bold,
)

16. CommonCard

๐Ÿ’ก Purpose: Simple structured wrapper offering standard elevation, borders, padding, and uniform card layout formats. ๐Ÿš€ Usage:

CommonCard(
  child: Text('Card Content'),
)

17. CommonImage

๐Ÿ’ก Purpose: Dynamic multi-source image loader that supports asset images, vector SVGs, and network URLs with automatic caching and shimmers. ๐Ÿš€ Usage:

CommonImage(
  src: 'https://images.unsplash.com/...',
  height: 200,
  borderRadius: BorderRadius.circular(16),
)

18. CommonSvgIcon

๐Ÿ’ก Purpose: Renders asset-based SVG images cleanly, injecting custom colors via single-filter color blending. ๐Ÿš€ Usage:

CommonSvgIcon(
  asset: 'assets/icons/verified.svg',
  color: Colors.blue,
)

19. CommonListView<T>

๐Ÿ’ก Purpose: Scroll list with built-in pull-to-refresh, empty states, and infinite pagination loading indicators. ๐Ÿš€ Usage:

CommonListView<String>(
  items: controller.itemsList,
  onRefresh: () => controller.refresh(),
  onLoadMore: () => controller.loadNextPage(),
  itemBuilder: (context, item, index) => ListTile(title: Text(item)),
)

20. CommonGridView<T>

๐Ÿ’ก Purpose: Lazy-loaded paginated grid built with integrated pull-to-refresh and separation properties. ๐Ÿš€ Usage:

CommonGridView<String>(
  items: controller.itemsList,
  crossAxisCount: 2,
  itemBuilder: (context, item, index) => GridItem(item),
)

๐Ÿ“ Category 3: Interactive Pickers & Bottom Sheets #

21. CommonCountryPicker

๐Ÿ’ก Purpose: Searchable modal bottom sheet selector for global countries, highlighting queries and matching check indicators. ๐Ÿš€ Usage:

final result = await CommonCountryPicker.show(
  context: context,
  selectedCountryCode: selected?.code,
);

22. CommonDatePicker

๐Ÿ’ก Purpose: Premium iOS-style Cupertino date selection wheel in a modern, dark-mode compatible bottom sheet drawer. ๐Ÿš€ Usage:

final result = await CommonDatePicker.show(
  context: context,
  initialDate: DateTime.now(),
);

23. CommonTimePicker

๐Ÿ’ก Purpose: Cupertino hour/minute time wheel inside a modern dark-mode compatible bottom sheet, returning a standard TimeOfDay. ๐Ÿš€ Usage:

final selectedTime = await CommonTimePicker.show(
  context: context,
  initialTime: TimeOfDay.now(),
);

24. CommonMultiImagePicker

๐Ÿ’ก Purpose: Compressed multi-file image selector with thumbnail grids, delete hooks, and memory-safe resolution downscaling. ๐Ÿš€ Usage:

CommonMultiImagePicker(
  maxImages: 5,
  onImagesChanged: (files) => controller.selectedImages.assignAll(files),
)

๐Ÿ“ Category 4: Dialogs & Notifications #

25. CommonDialog

๐Ÿ’ก Purpose: Premium alert and choice dialog supporting success, error, warning, info, and confirmation variants. ๐Ÿš€ Usage:

final confirmed = await CommonDialog.showConfirmation(
  context: context,
  title: 'Delete Item?',
  subtitle: 'Confirm permanent deletion.',
);

26. CommonSnackbar

๐Ÿ’ก Purpose: Custom floating alert notification panel built on top of Get.snackbar featuring colored feedback bars. ๐Ÿš€ Usage:

CommonSnackbar.showSuccess(title: 'Success', message: 'Action completed.');

27. LoadingDialog

๐Ÿ’ก Purpose: Modal overlay layout that blocks touch gestures during heavy asynchronous processing events. ๐Ÿš€ Usage:

showDialog(
  context: context,
  barrierDismissible: false,
  builder: (context) => const LoadingDialog(message: 'Processing...'),
);

๐Ÿ“ Category 5: Loading Indicators, Shimmers & Skeletons #

28. ShimmerBox

๐Ÿ’ก Purpose: Core rectangular skeleton block used to create loading placeholder cards. ๐Ÿš€ Usage:

ShimmerBox(width: 120, height: 16)

29. CommonShimmerCard

๐Ÿ’ก Purpose: Pre-formatted card placeholders that match list items layout definitions. ๐Ÿš€ Usage:

const CommonShimmerCard()

30. LoadingOverlay

๐Ÿ’ก Purpose: Translucent full-screen overlay panel showing custom spinner messages. ๐Ÿš€ Usage:

LoadingOverlay(message: 'Uploading...')

31. PaginationLoader

๐Ÿ’ก Purpose: Subtle foot loader shown at list margins during page pagination. ๐Ÿš€ Usage:

PaginationLoader()

๐Ÿ“ Category 6: Empty, Offline & Error Fallback Views #

32. EmptyStateWidget

๐Ÿ’ก Purpose: Fallback illustration displayed when collection elements return empty lists. ๐Ÿš€ Usage:

EmptyStateWidget(
  title: 'No Data',
  description: 'Try adding elements.',
)

33. ErrorStateWidget

๐Ÿ’ก Purpose: Retry illustration display presented when data fetching fails. ๐Ÿš€ Usage:

ErrorStateWidget(
  errorMessage: 'Something went wrong.',
  onRetry: () => controller.reload(),
)

34. NoInternetWidget

๐Ÿ’ก Purpose: View shown automatically when device internet connectivity is offline. ๐Ÿš€ Usage:

NoInternetWidget(onRetry: () => controller.retry())

35. RetryWidget

๐Ÿ’ก Purpose: Simple inline action trigger to re-perform failed processes. ๐Ÿš€ Usage:

RetryWidget(onRetry: () => controller.retry())

๐Ÿ“ฑ Premium High-Readability Extensions #

Unified extension methods reduce widget layout tree nesting:

1. Spacing Extensions (lib/core/utils/extenstion/screen_extensions.dart) #

Append .height or .width to integers or doubles for responsive layout spacing:

  • 16.height โ€” Responsive SizedBox(height: 16.h)
  • 24.width โ€” Responsive SizedBox(width: 24.w)

2. Context Extensions (lib/core/utils/extenstion/context_extensions.dart) #

Directly access themes, color schemes, and screen dimension constraints from the current context:

  • context.theme โ€” Quick access to Theme.of(context)
  • context.colorScheme โ€” Quick access to the color scheme tokens
  • context.screenWidth โ€” Current display width

3. Widget Layout Extensions (lib/core/utils/extenstion/widget_extensions.dart) #

Add responsiveness, paddings, and alignment inline without wrapping widgets manually:

  • widget.paddingAll(16.h)
  • widget.paddingSymmetric(horizontal: 20.w)
  • widget.visible(condition)

Example usage:

import 'package:your_project_name/core/utils/extenstion/screen_extensions.dart';
import 'package:your_project_name/core/utils/extenstion/context_extensions.dart';
import 'package:your_project_name/core/utils/extenstion/widget_extensions.dart';

@override
Widget build(BuildContext context) {
  return Column(
    children: [
      CommonText(
        'Workspace Settings',
        style: context.textTheme.headlineMedium,
        color: context.colorScheme.primary,
      ),
      12.height,
      CommonText(
        'Subheading',
        style: context.textTheme.bodyMedium,
      ).paddingSymmetric(horizontal: 16.w),
    ],
  );
}

๐Ÿ” System Services & Helpers #

1. System Permissions Utility (PermissionHelper) #

Managed under lib/services/permissions/permission_helper.dart, this helper allows silent checking of permission states before request triggers:

// Check if access is already granted
final bool isAlreadyGranted = await PermissionHelper.check(Permission.camera);

if (!isAlreadyGranted) {
  // Triggers native system prompt dialog
  final bool status = await PermissionHelper.camera();
  if (!status) {
    // If permanently denied, prompt user to redirect to App System Settings
    await openAppSettings();
  }
}

2. URL & Intent Launcher Helper (UrlLauncherHelper) #

Easily trigger email intents, website URLs, and external applications securely:

UrlLauncherHelper.email("support@example.com");
UrlLauncherHelper.open("https://pub.dev");

๐Ÿ“„ License #

This project is licensed under the MIT License. See the LICENSE file in the repository for details.

6
likes
0
points
478
downloads

Publisher

unverified uploader

Weekly Downloads

Command-line interface to generate premium Flutter starter boilerplates utilizing GetX and Clean Architecture.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

args, path

More

Packages that depend on getx_boilerplate_cli