Our Flutter template is built with carefully selected packages that provide robust functionality while maintaining clean architecture and best practices. This guide will walk you through the core packages we use and explain why they’re essential for your app development journey.

Core Package Categories

Our template utilizes several categories of packages, each serving a specific purpose in the application architecture:

1. Networking Packages

These packages handle all API communications and data serialization:

Retrofit & Dio

dependencies:
  retrofit: ^4.0.0
  dio: ^5.0.0

Retrofit is a type-safe HTTP client generator that works seamlessly with Dio. This powerful combination offers:

  • Type-safe API calls
  • Automatic serialization/deserialization
  • Interceptors for request/response manipulation
  • Easy request cancellation
  • Built-in error handling
  • Support for multipart requests
  • Automatic retry mechanisms

2. Code Generation & Data Classes

For efficient data handling and boilerplate reduction:

Freezed & Build Runner

dependencies:
  freezed: ^2.4.0
  build_runner: ^2.4.0

Freezed is our choice for data class generation because it provides:

  • Immutable data structures
  • Union types / sealed classes
  • Easy JSON serialization
  • Copy with functionality
  • Equality comparisons

Build Runner works behind the scenes to:

  • Generate necessary code
  • Handle code generation pipeline
  • Support incremental builds

3. Dependency Injection

For clean architecture and testability:

GetIt

dependencies:
  get_it: ^7.6.0

GetIt serves as our service locator, offering:

  • Simple dependency injection
  • Lazy singleton support
  • Easy testing setup
  • Global state management
  • Asynchronous initialization

4. Navigation & Routing

Modern navigation and deep linking support:

Go Router

dependencies:
  go_router: ^13.0.0

Go Router is Flutter’s recommended routing package that provides:

  • Declarative routing API
  • Deep linking support
  • URL-based navigation
  • Nested navigation
  • Route guards and redirects
  • Type-safe route parameters
  • Integration with Flutter’s Navigator 2.0
  • Web URL strategy support

5. App Configuration Packages

These packages help with app setup and configuration:

Flutter Launcher Icons

dev_dependencies:
  flutter_launcher_icons: ^0.13.0

Flutter Launcher Icons simplifies:

  • App icon generation for all platforms
  • Adaptive icon support for Android
  • Different icon sizes for various devices

Change App Package Name

dev_dependencies:
  change_app_package_name: ^1.1.0

Change App Package Name helps with:

  • Quick package name updates
  • Automatic manifest updates
  • Gradle configuration changes