https://github.com/mhmzdev/flutter_single_code
An exmaple of setting up and manaing the single code base in flutter - web + mobile + tablet
https://github.com/mhmzdev/flutter_single_code
Last synced: 8 months ago
JSON representation
An exmaple of setting up and manaing the single code base in flutter - web + mobile + tablet
- Host: GitHub
- URL: https://github.com/mhmzdev/flutter_single_code
- Owner: mhmzdev
- Created: 2025-08-17T07:18:33.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-08-17T08:10:32.000Z (8 months ago)
- Last Synced: 2025-08-17T10:06:03.612Z (8 months ago)
- Language: C++
- Size: 265 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Flutter Single Code Base
This repo is giving a minimal example of setting up and managing the single code for mobile, tablet and desktop in flutter.
| A complete guide is available in [architecture_guide.md](docs/architecture_guide.md)
## 📸 Video & Written Tutorial
- YouTube video series: https://youtu.be/_ZASShlSHs8. If you want to follow the progress, you can follow along the Parts branches given.
- Written tutorial: https://mhmzdev.medium.com/the-art-of-managing-single-code-base-flutter-part-01-80ab2ad2ad9d
## Overview
It covers the flow as:
- ✅ Separate UI for each view
- ✅ Shared state/logic for all views - Single Source of Truth
- ✅ Platform specific UI and Functionality

## 🧱 Architecture
A screen structure would like this:
```
tasks/
├── tasks.dart # Main screen entry point
├── _state.dart # Shared state management
├── views/
│ ├── _desktop.dart # Desktop-specific UI
│ ├── _mobile.dart # Mobile-specific UI
│ └── _tablet.dart # Tablet-specific UI
└── widgets/
├── _categories_list.dart
├── _task_details.dart
└── _tasks_list.dart
```
## ➡️ Up next
Will be talking about following in coming tutorials:
- Managing single code via Monorepo architecture
- Modularization
- Melos package
## 🔑 License
This project is licensed under the MIT License - see the [LICENSE](LICENSE.md) file for details
## 🙋♂️ Author
#### Muhammad Hamza
[](https://www.linkedin.com/in/mhmzdev)
You can also follow my GitHub Profile to stay updated about my latest projects:
[](https://github.com/mhmzdev)
If you liked the repo then kindly support it by giving it a star ⭐!
Copyright (c) 2025 MUHAMMAD HAMZA
