Skip to content

A modern Flutter starter template featuring clean architecture and Riverpod state management, designed for scalable app development. Powered by Mason for efficient code generation.

License

Notifications You must be signed in to change notification settings

HasanAlqaisi/flutter_starter

Repository files navigation

flutter_starter

Powered by Mason

A new brick created with the Mason CLI.

Generated by mason 🧱

Getting Started 🚀

This is a starting point for a new brick.

A few resources to get you started if this is your first brick template:

Flutter Starter Template

A modern Flutter starter template with a clean architecture, state management using Riverpod, and best practices for scalable applications.

Project Structure

The project follows a feature-first approach with a clear separation of concerns:

📁 lib/

├── 📁 app/

│   ├── 📁 common/

│   │   ├── 📁 widgets/     # Reusable widgets across the app

│   │   ├── 📁 services/    # Shared services

│   │   └── 📁 utils/       # Common utility functions and helpers

│   │

│   └── 📁 feature_example/ # Example of a feature module

│       ├── 📁 data/        # Data Layer

│       │   ├── 📁 datasources/  # API clients, local storage

│       │   ├── 📁 models/       # Data transfer objects (DTOs)

│       │   └── 📁 repositories/ # Repository implementations

│       │

│       ├── 📁 domain/      # Business Logic Layer

│       │   ├── 📁 entities/     # Core business objects

│       │   ├── 📁 repositories/ # Repository interfaces

│       │   └── 📁 usecases/     # Business logic units

│       │

│       └── 📁 presentation/ # UI Layer

│           ├── 📁 pages/        # Feature screens

│           ├── 📁 widgets/      # Feature-specific UI components

│           └── 📁 providers/    # State management

│

├── 📁 core/              # Core Infrastructure

│   ├── 📁 constants/     # App-wide constants and configurations

│   ├── 📁 extensions/    # Dart extension methods

│   ├── 📁 failures/      # Error handling classes

│   ├── 📁 http/         # HTTP client configuration

│   ├── 📁 router/       # Navigation setup (AutoRoute)

│   └── 📁 storage/      # Secure storage implementation

│

├── 📁 ui/               # Global UI Components

│   ├── 📁 theme/        # App theming

│   └── 📁 example/      # Example UI components

│

├── 📄 main.dart         # Entry point

└── 📄 main_providers.dart # Global Riverpod providers

Key Features

  • 🏗️ Feature based

  • 🚀 Riverpod for state management

  • 🌐 Dio for HTTP requests

  • 🗺️ AutoRoute for navigation

  • 🔐 Secure storage

  • 🎨 Customizable theme with Google Fonts

  • 📱 Responsive design

  • 🔍 Easy-to-follow folder structure

  • 🧪 Example feature implementation

  • 🌍 Internationalization with slang

  • 📝 Form handling with reactive_forms (optional)

Getting Started

  1. Clone this repository

  2. Install mason

  3. Run mason make flutter_starter

Best Practices

  • Follow the feature-first approach

  • Use dependency injection with Riverpod

  • Implement proper error handling

  • Write clean and maintainable code

  • Follow Flutter's style guide

Dependencies

Main Dependencies

  • flutter_riverpod: State management

  • hooks_riverpod: Riverpod with hooks

  • flutter_hooks: Hooks-based state management

  • auto_route: Navigation and routing

  • dio: HTTP client

  • fpdart: Functional programming utilities

  • flutter_secure_storage: Secure storage

  • google_fonts: Typography

  • fluttertoast: Toast messages

  • shared_preferences: Local storage

  • slang: Internationalization

  • dart_mappable: Object mapping

  • reactive_forms: Form handling (optional)

Dev Dependencies

  • build_runner: Code generation

  • riverpod_generator: Riverpod code generation

  • custom_lint: Custom lint rules

  • riverpod_lint: Riverpod lint rules

  • dart_mappable_builder: Object mapping code generation

  • auto_route_generator: AutoRoute code generation

  • slang_build_runner: Internationalization code generation

  • flutter_gen_runner: Asset generation

About

A modern Flutter starter template featuring clean architecture and Riverpod state management, designed for scalable app development. Powered by Mason for efficient code generation.

Topics

Resources

License

Stars

Watchers

Forks