Mobile App

Build Flutter Apps Faster: Leverage the Power of Templates

October 9, 2024
6 mins
Flutter app template

Are you tired of starting each new Flutter project from scratch, adding essential features like flavors, icons, splash screens, offline app handling, theming, notifications, and analytics? Our template repository simplifies this process, providing a solid foundation that accelerates your development journey, allowing you to focus on what truly matters.

With pre-built components and best practices at your fingertips, you can bring your app ideas to life faster than ever before.

We offer two types of templates:

  • Free Flutter Template: Provides a solid foundation with core features like utilities, dependency injection, internationalizations, etc.
  • 👑Premium Flutter Template: Offers advanced capabilities and customization options like flavors, splash-screen, offline support, etc.

Whether you need a basic foundation or advanced customization options, our templates offer a streamlined development experience.

To help you choose the right template, we've provided a detailed comparison table that outlines the features included in both the Free as well as Premium Flutter Templates:

Features Free 👑Premium
Flutter Project
Clean Folder Structure
Build-in Required Packages
Utilities
Dependency Injection
Internationalization
Flavor Setup
Icons Generation
Splash Screen
Generation
Setup script
Firebase Integration
Offline App Handling
Authentication
Remote Config
Update Mechanism
Theming
Notifications
Analytics
Background Fetch
Deeplink
Static Pages

Legends:

Completed

Pending

Not Included

How to get started?

Free Template

To get started with this free template, follow these steps:

1. Clone the Repository:

git clone https://github.com/CW-Codewalnut/free_flutter_template

2. Change directory to flutter_template

cd flutter_template

3. Install Dependencies:

flutter pub get

👑Premium template 

To access the Premium template, you need to purchase a license.

Please contact us at nattu@codewalnut.com for more information.

What features does it have?

1. Clean Folder Structure

The folder structure is designed to be easy to understand, manage, scale & maintain.

lib:

common:

This folder contains reusable code shared across the app. It includes subfolders like:

  • exceptions: Contains all the custom extensions in the app
  • extension: Contains all the extensions in the app like time-formatting, date-formatting, etc.
  • mixins: Mixins used throughout the app.
  • translations: It has translations-related files (e.g localekeys class)
  • widgets : Contains common UI components like buttons, banners, app bars, etc.
  • models: Data models used across the app.
  • utils: Helper functions and utilities for various tasks like form validation.

features

The repository follows a feature-based folder structure. Each app feature is isolated within its own folder, making it easier to manage and scale. Each feature folder might include its own widgets, models, and logic, ensuring modularity.

core

This folder contains foundational elements essential to the entire app, such as routes, themes, dependencies, global keys, logger, etc. These components are crucial for the app's overall architecture and are reused throughout the project.

assets: Contains all the assets used in the app.

  • images: Stores all image files used in the app.
  • fonts: Custom fonts used in the app.
  • svg: Contains SVG images
  • translations: Contains language translations
  • anim: Contains animations file in Lottie json

dev_assets: Contains all the assets needed for development like icon images, splash screen images, etc which will help generate the icon and splash screen.

Free:

👑Premium: 

scripts: The scripts folder contains shell scripts that automate common tasks during the app development process. These scripts help streamline building and generating assets for different environments.

Free:

👑Premium: 

2. Utilities

The utilities (or utils) are used to store reusable helper classes and functions that assist with various common tasks across the app. These are typically not specific to any particular feature but are instead general-purpose tools that can be used throughout the project.

common

exceptions:

extensions:

mixins:

utils:

  • app_assets.dart: Central place to access app assets like images, fonts, and icons.
  • app_locales.dart: Contains supported locales within the app.
  • constants.dart: Defines and stores constant values used throughout the app, such as API endpoints or fixed strings.
  • input_formatter.dart: Provides utilities for formatting user input, like phone numbers in text fields.
  • timer.dart: Includes utility functions or classes for managing timers or countdowns within the app.
  • utils.dart: A general-purpose file for various utility functions and helpers that don’t fit into the other specific categories like url launcher, download etc.
  • validator.dart: Contains functions for validating user input, such as checking email formats or password strength.

core:

  • app_directory_path.dart: Initializes and manages the application's document directory.
  • app_routes.dart: Defines and manages the app’s navigation routes.
  • app_theme.dart: Contains the app’s theme settings, such as colors, fonts, and styles.
  • core.dart: Centralizes and exports all files in the core folder for easy import across the app.
  • dependency_manager.dart: Manages dependency injection, initializing and providing services across the app.
  • env_configs.dart (👑premium) : Stores environment-specific configurations like APIs base url.
  • global_keys.dart: Defines global keys used throughout the app, such as  ScaffoldMessengerKey for managing the state of snack bars.
  • logger.dart: Handles logging throughout the app, useful for debugging and tracking issues.
  • store_manager.dart: Manages secure and non-secure data storage, handling encryption where needed for central control of app data.

scripts:

  • build_apk.sh: Script to build an APK.
  • build_apk_dev.sh (👑premium): Script to build an APK for the development environment.
  • build_apk_prod.sh  (👑premium): Script to build an APK for the production environment. 
  • build_apk_stg.sh  (👑premium): Script to build an APK for the staging environment. This is useful for testing in an environment similar to production but not public-facing.
  • build_app_bundle.sh: Script to build an Android App Bundle (AAB).
  • build_app_bundle_prod.sh (👑premium): Script to build an Android App Bundle (AAB) for the production environment.
  • generate_app_icons.sh: Script to automatically generate app icons for various screen sizes and platforms from a single image source.
  • generate_locales.sh: Script to generate localization files for the app.

Free:

👑Premium: 

3. Build-in Required Packages

This template comes with pre-installed most required packages so that you don't need to add it yourself. You can check the pubspec.yaml for the full list of packages or check it below.

Networking

Logging

  • logger: A simple logger for debugging and tracking application behavior.

UI Components

Routing

  • go_router: Provides a declarative routing API for Flutter.

State Management

  • flutter_bloc: State management using BLoC (Business Logic Component) pattern.

Dependency Injection

  • get_it: Service locator for dependency injection.

Internationalization

  • easy_localization: Simplifies localization in Flutter.
  • intl: Internationalization and localization support.

Utilities

Storage

  • hive: Lightweight and fast key-value database.
  • path: Path manipulation utilities.

Security

File Handling

Background Jobs

Analytics

Firebase Integration

Authentication

Remote Config

Notifications

Development Dependencies

4. Dependency Injection

This template includes a dependency injection setup using get_it. For more information, refer to the get_it documentation. Dependencies are defined in core/dependency_manager.dart.

5. Internationalization

We use easy_localization for internationalization. Refer to the easy_localization documentation for further details. By default, the template supports two locales: English (USA) and Hindi (India).

6. Icons Generation

For automatic icon generation across different screen sizes and platforms, we utilize the flutter_native_splash package. Simply place your desired icons in the dev_assets folder, similar to our existing setup. Then, run the generate_app_icons.sh script, which will generate icons for each flavor (applicable only to the 👑premium version).

Icon Configuration:

Free Version: You can customize your app icons directly in the flutter_launcher_icons.yaml file.

👑Premium Version: For greater control, we provide separate configuration files for each flavor:

flutter_launcher_icons-dev.yaml (Development)

flutter_launcher_icons-stg.yaml (Staging)

flutter_launcher_icons-prod.yaml (Production)

7. Flavors (👑premium): This feature is exclusively available in the premium version. It offers three distinct environments: development, staging, and production. Each environment has its unique icon, splash screen, application ID, and configuration settings, which are defined in the core/env_configs.dart file.

We've also integrated run configurations for Android Studio to streamline development and testing across these different environments.

Now that you have insights into the codebase—understanding the purpose of each file, the rationale behind selected libraries, and the pre-built boilerplates available—you’re well-equipped to hit the ground running. Start building your next project confidently, and take advantage of the features designed to simplify and speed up your workflow. Explore our repository today and elevate your Flutter experience!

Free Flutter Template: https://github.com/CW-Codewalnut/free_flutter_template

Premium Flutter template: Contact us at nattu@codewalnut.com

Want help with your react app?

Get in touch - Our team has developed scalable solutions for enterprises and has a Crunch rating of 4.9⭐.

Contact us
Author
Kaiser Perwez
Kaiser Perwez
Tech lead | Full stack Engineer
Ranjan Bhagat
Ranjan Bhagat
Software Engineer
Disclaimer: This article outline is created by Humans, content is written by AI and the final article is reviewed & edited by a CodeWalnut engineer.
Next-JS Logo
Kickstart your
Mobile App
project

Experience coding prowess firsthand. Choose CodeWalnut to build a prototype within a week and make your choice with confidence.

Book a Meeting
Vercel Logo
Kickstart your
Mobile App
project

Accelerate your web app vision with CodeWalnut. In just a week, we'll shape your idea into a polished prototype, powered by Vercel. Ready to make it real? Choose us with confidence!

Book a Meeting
Heroku Logo
Kickstart your
Heroku
project

Dreaming of a powerful web app on Heroku? Let CodeWalnut bring it to life in just one week. Take the leap and trust us to deliver with confidence!

Book a Meeting
Download Free Template

Open Source Java + React Code with API and Database Configuration

Test Code

Related posts

You are just one step away!

Enter your Email to receive free template developed by CodeWalnut Experts

Thank you! Your template has been sent Successfully!

Before you rush to your inbox, Do you know CodeWalnut offers free consultation?
Contact Us
Oops! Something went wrong while submitting the form.
You are just one step away!

Enter your Email to receive free template developed by CodeWalnut Experts.

Thank you! Your template has been sent Successfully!

Before you rush to your inbox, Do you know CodeWalnut offers free consultation?
Contact Us
Oops! Something went wrong while submitting the form.
You are just one step away!

Enter your email to receive the PR checklist prepared by CodeWalnut experts.

Thank you! Your PR Checklist has been sent Successfully!

Before you rush to your inbox, Do you know CodeWalnut offers free consultation?
Contact Us
Oops! Something went wrong while submitting the form.
Need help with building your next application?
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
What best describes you?
Beginner Programmer
Tech Manager
Enterprise IT Leader
Here are some useful resources for you
A boilerplate for React + Java
PR checklist to control code quality
Download Free Template
Open Source Java + React Code with API and Database Configuration
Download now
Here are some useful resources for you
React-Java Boilerplate
A boilerplate for React + Java
PR checklist to control code quality

Book a 15 min session to build your bulletproof development lifecycle

Book a meeting
Nattu
Nattu, Co Founder
Need help with building your next application?
Yes! Show me how