Jumpstart Your Flutter Development with Bare Bones Flutter
In the fast-paced world of mobile app development, efficiency and speed are paramount. Starting a Flutter project from scratch can be time-consuming, especially when aiming for a robust and maintainable codebase. This is where Bare Bones Flutter comes in — a comprehensive template designed for Flutter developers who want to hit the ground running without the hassle of setting up essential features from scratch.
What is Bare Bones Flutter?
Bare Bones Flutter is a template project tailored for Flutter developers. It serves as a starting point, providing a solid foundation to build upon, ensuring stability, and speeding up the development process. Whether creating a simple or complex app with multiple features, Bare Bones Flutter equips you with the necessary tools and structure to get started quickly.
Why Bare Bones Flutter?
The Bare Bones Flutter template focuses on the architecture and logic of the app, not the user interface. This is intentional: by keeping the template simple and focusing on core features, we ensure that developers can easily adapt the project to their specific needs and preferences. This flexibility is crucial for developers who want to update the project with their custom UI components or additional features. The Bare Bones Flutter template provides a solid foundation that is simple yet strong, making it easy to add or remove features as needed.
Key Features
Localization
Global reach is a critical aspect of modern applications. Bare Bones Flutter supports multiple languages (EN, TR), making it easier to cater to a diverse audience. The template includes localization files, ensuring your app can communicate effectively with users worldwide. You can create more languages using the MakeFile, easily:
make -f Makefile localization
MVVM Architecture
Maintainability is a key concern in software development. Bare Bones Flutter adopts the Model-View-ViewModel (MVVM) architecture, which promotes a clean and organized codebase. This architecture separates the development of the graphical user interface from the business logic or back-end logic (the model), ensuring your code is more manageable and scalable.
Authentication Pages
User authentication is a fundamental feature in most apps. The template includes pre-built Sign In and Sign Up pages, complete with text form fields validated using regular expressions. This setup not only saves development time but also ensures that user inputs are correctly formatted and secure.
Navigation
Efficient navigation is essential for a smooth user experience. Bare Bones Flutter utilizes go_router for straightforward navigation and shell_route for nested routing. This setup ensures that moving between different parts of your app is seamless and intuitive.
Firebase Integration (firebase-riverpod branch)
For developers looking to incorporate Firebase into their applications, Bare Bones Flutter offers a dedicated branch — firebase-riverpod. This branch builds on the main template by adding Firebase integration, including functional Sign In, Sign Out, and Sign Up features. It also incorporates Riverpod for state management, providing a robust solution for handling app state cleanly and reactively.
Branches Overview
Bare Bones Flutter is structured into two main branches:
main
It contains the essential features of the template, focusing on providing a solid foundation without any state management or ViewModel. It is ideal for developers who prefer to add their custom functionalities and state management solutions.
firebase-riverpod
It extends the main template by integrating Firebase for user authentication and incorporating Riverpod for state management. It is perfect for developers who need a ready-to-use solution for authentication and state management.
General Project Structure
Here’s a quick overview of the project’s directory layout (created from this website: https://ascii-tree-generator.com/):
lib/
├─ core/
│ ├─ constants/
│ ├─ design_system/
│ ├─ di/
│ ├─ init/
├─ data/
│ ├─ di_repository/
│ ├─ repository/
├─ domain/
│ ├─ di_usecase/
│ ├─ model/
│ ├─ usecase/
├─ features/
│ ├─ auth/
│ ├─ dashboard/
│ ├─ navigation/
│ ├─ profile/
│ ├─ search/
├─ l10n/
│ ├─ en.arb
│ ├─ tr.arb
├─ main.dart
Core
The core directory contains core functionalities such as constants, design system, dependency injection (di), and initialization code.
Data
The data layer handles data retrieval and storage, including repository implementations and dependency injection for repositories.
Domain
The domain layer defines the business logic, including models and use cases. It separates the core logic from other layers, ensuring a clean architecture.
Features
Each feature of the app is organized into its directory, making it easy to locate and manage specific functionalities like authentication, navigation, and user profiles.
Localization
The localization directory contains .arb files for different languages, enabling easy localization and internationalization of the app.
Makefile
To simplify task management, Bare Bones Flutter includes a Makefile. This file contains commands for common tasks such as generating localization files and cleaning the project.