Skip to content

firad-bdevs/starter-template

Repository files navigation

🚀 Flutter Ultimate Clean Architecture Template

A production-ready Flutter Starter Template meticulously structured using Clean Architecture patterns securely powered natively by GetX. This fully modular toolkit scales seamlessly, enabling lightning-fast UI rendering alongside highly optimized robust data workflows!


🏗 Directory Structure

This project completely isolates responsibilities natively across dedicated modules:

lib/
├── app.dart                        # Core MaterialApp Initialization
├── main.dart                       # App entry point natively bound to initialization
├── bindings/
│   └── app_binding.dart            # Centralized GetX Dependency Injection
├── core/                           # Foundation Utilities shared globally
│   ├── network/                    # API Endpoints and Custom NetworkCaller Engine
│   ├── storage/                    # GetStorage persistence interface
│   ├── theme/                      # Separated Dark/Light mode color schemes
│   ├── localization/               # Externalized EN, AR, BN mapped translation dictionaries
│   ├── utils/                      # Settings global utils, Assets structural mapper
│   └── widgets/                    # Core generic UI components (Buttons, Skeleton items, Svgs)
├── features/                       # Segmented modular apps exactly implementing clean workflows
│   └── home/
│       ├── view/                   # UI Display using purely StatelessWidget
│       ├── controller/             # Business Logic & Rx States (GetX)
│       ├── service/                # Direct Data Layer APIs cleanly communicating outwards
│       └── model/                  # Domain Data schemas
└── routes/
    ├── app_pages.dart              # Global Navigation mappings statically
    └── app_routes.dart             # Distinct string-based Route mapping URLs

🚀 Initial Setup & Installation

To initialize this cleanly built template precisely from scratch anywhere:

  1. Clone & Enter the Repository

    git clone https://github.com/firad-bdevs/starter-template.git
    cd starter-template
  2. Fetch Dependencies Run the following to completely pull down all explicitly bounded GetX, Networking, and Assets packages natively:

    flutter pub get
  3. Launch the App

    flutter run

✨ Outstanding Features Enabled Out Of The Box

📡 1. Robust API NetworkCaller

Includes an advanced, globally injected NetworkCaller.

  • Automatically parses success and error JSON gracefully without UI crashing.
  • Includes JWT Auto-Refreshing Token mechanisms built inside _getHeaders() and _sendRequest().
  • Supports transparent background fetches. Easily disables UI-blocking EasyLoading overlays by setting showLoading: false inside requests!

⚙️ 2. Universal State & Dependency Injection (GetX)

No messy StatefulWidget sprawl or un-traceable components:

  • Centralized AppBinding natively handles injecting global Singletons (StorageService, NetworkCaller, etc.) the exact moment the app mounts.
  • Controllers bind to data gracefully allowing strictly optimal single-page modular logic! All Views are strictly StatelessWidget.
  • Dependency Retrieval relies solely on Get.find<Controller>() maximizing tree efficiency.

🌐 3. Multi-Language (Localization & RTL)

Instantly globalize natively!

  • Supports English, Arabic (Right-to-Left Layout perfectly supported), and Bengali.
  • Translations mapped to individually externalized files cleanly residing inside lib/core/localization/langs/.
  • Changing the language (SettingsUtil.changeLanguage(lang)) natively re-evaluates the active Layout Direction.

🌓 4. Dual Theming System & Persistence

A dedicated structural SettingsUtil powers universal theming optimally!

  • Changes between Light, Dark, and System seamlessly with SettingsUtil.changeTheme(theme).
  • Dedicated primitives locally stored internally inside light_colors.dart and dark_colors.dart makes designing new components extremely foolproof.
  • Instantly retains choices natively inside persistent storage dynamically, reloading perfectly on app-boot instantly without weird flashing layouts!

📦 5. Scalable Asset Management

Cleanly structured UI integrations explicitly separated inside core/utils:

  • IconPath securely natively bounds assets/icons/.
  • ImagePath structurally manages assets/images/.
  • Ready-to-use globally generic CustomSvgIcon widget seamlessly renders vectors without needing native context lookups.

⏳ 6. Pristine UI Handlers (Shimmers & Layout)

Tired of generic App Loading Spinners?

  • Skeleton List placeholders optimally deployed precisely behind clean interfaces safely mimicking your Layout shapes directly while API loads data softly into grids.

🛠 Getting Started Fast

1. Generating a New Feature Model

Whenever extending a new module securely (like Profile or Settings):

  1. Model: Set up your JSON Model inside features/[name]/model/
  2. Service: Hook up endpoints to NetworkCaller sequentially inside features/[name]/service/.
  3. Controller: Fetch that explicit data securely loading values natively across RxList items inside features/[name]/controller/.
  4. View: Present your interface purely relying on Get.find<MyController>() explicitly inside features/[name]/view/.
  5. Route: Setup your strings natively into AppRoutes and integrate into AppPages mapping precisely.

2. Theming Extensibility

To deeply structure entirely new elements inside your apps globally, simply append generic styling blocks natively over inside: lib/core/theme/dark_theme.dart AND lib/core/theme/light_theme.dart pulling specifically exclusively from the strictly defined generic DarkColors and LightColors.

3. Adding New Supported Languages

Adding languages flawlessly works entirely through three explicit additions:

  1. Create your definitions uniquely inside lib/core/localization/langs/my_lang.dart.
  2. Map it seamlessly into AppTranslations index file mappings natively.
  3. Call SettingsUtil.changeLanguage('xx') freely from any button on any screen!

Authored optimally for rapid scalability and extreme code readability. Never struggle to find where API calls or UI states originate again!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors