Skip to content

A scalable Flutter app template that uses flutter_bloc and go_router. Save weeks of work for your next Flutter app πŸš€

License

Notifications You must be signed in to change notification settings

nazarrd/scalable_flutter_app_starter

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

22 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Scalable Flutter App Starter

πŸ‘‹ Hey, welcome to Scalable Flutter App.

Watch/star this repo to be notified when updates are pushed.

Table of Contents

What is Scalable Flutter App?

Scalable Flutter App is a starter template for Flutter apps.

It's designed to be scalable and easy to maintain. And should save you weeks of development time.

To get started, click on the green "Use this template" button on the top-right.

About the Author

I'm Milos Jokic and I:

  • built my first mobile app in 2007
  • grew my apps to 214k users and $106,140 revenue.
  • built apps for 10 Toptal clients.

And now I run a 6-figure devs agency where we launch MVPs in 4 weeks using Flutter & Firebase.

You can find me on:

Features

Feature Starter Pro
Platforms: Android, iOS, web βœ… βœ…
Scalable Architecture using flutter_bloc βœ… βœ…
Navigation using go_router βœ… βœ…
Scalable App Styling βœ… βœ…
GitHub Actions - code and formatting check βœ… βœ…
Responsive Design βœ… βœ…
UserMockProvider βœ… βœ…
Profile Page βœ… βœ…
Settings Page: sign out, app version... βœ… βœ…
Legal: Terms, Policy, Data Deletion βœ… βœ…
Google Fonts βœ… βœ…
Sign in and Sign Up Pages βœ… βœ…
Input Validators βœ… βœ…
Cached network image βœ… βœ…
Email Support ❌ βœ…
Lifetime Updates ❌ βœ…
Firebase Project Integration ❌ βœ…
Firebase Authentication ❌ βœ…
Firebase Remote Config ❌ βœ…
Firebase Crashlytics ❌ βœ…
Firebase Firestore ❌ βœ…
Firebase Analytics ❌ βœ…
Firebase Storage ❌ βœ…
Google Sign In ❌ βœ…
Apple Sign In ❌ βœ…
Email Link Sign In ❌ βœ…
Common Cubits ❌ βœ…
In App Purchases (RevenueCat) ❌ βœ…
App Store Review Request ❌ βœ…
Notifications (Firebase) ❌ βœ…
HTTP Requests ❌ βœ…
Local Storage ❌ βœ…
Permissions ❌ βœ…
Environments ❌ βœ…
Localization ❌ βœ…
Dark Mode ❌ βœ…
Connectivity check ❌ βœ…
Hive - local database ❌ βœ…
MixPanel - analytics ❌ βœ…
Android - Release Signing ❌ βœ…
Onboarding ❌ βœ…
Forgot Password ❌ βœ…
πŸŽ‰ BONUS: Scalable Firebase Backend Template ❌ βœ…

Pro Presale Discount

Get Your Scalable Flutter App PRO for $47 ($200 OFF) Here

$200 off discount code (APP200) lasts until end of October.

Scalable Flutter App - Pro launches in November.

Docs

Code Architecture

The code architecture is based on flutter_bloc architecture proposal.

There are 4 layers:

  1. UI (Flutter Widgets)
  2. BLoC (stateful business logic)
  3. Repository (high-level API)
  4. Provider (low-level implementation)

And there's only 1 communication rule that we must follow:

The layer can only call the one layer below it.

That means that:

  • UI can only call BLoC
  • BLoC can only call Repository
  • Repository can only call Provider
  • Provider can only call external services (Firebase, HTTP, etc.)

And we avoid same-layer communication (as it creates interdependencies):

  • UserRepository calling AuthRepository is not allowed.
  • UserCubit calling UserRepository and AuthRepository is allowed.

Styling

Styling is based on Google's Material Design.

App-wide styling is defined in core/app/style.dart and is easy to update.

Here's a quick tip on custom Widget params. There are 2 Widget param types:

  • data (user, title, ...)
  • style (colors, paddings, ...)

Our custom Widgets should only hava data params.

And the style should be done app-wide (in style.dart).

That way all of our UI is consistent and easy to update.

Google Fonts

To change the font:

  1. Go to Google Fonts and select a font.
  2. Download the font files.
  3. Add the font files to assets/fonts (remove the old ones).
  4. Update style.dart with the new font (i.e. return GoogleFonts.rubikTextTheme(textTheme)).

Useful GitHub Pull Request Settings

I've found that turning on these 2 settings in GitHub repo settings helps a lot:

  1. Always suggest updating pull request branches
  2. Automatically delete head branches

FAQ

Why bloc and not X?

While GetX, Provider, Riverpod, MobX, Redux, etc. are all great solutions, most of them are too forgiving. They allow us to access and change state globally.

Whereas flutter_bloc forces us to have BuildContext in order to access and change the state. The stricter the rules, the harder it is to make mistakes.

And flutter_bloc has a great architecture proposal that scales well.

Who is Scalable Flutter App for?

Scalable Flutter App is for developers, agencies, and founders who want to:

  • build scalable Flutter apps
  • save weeks of development time
  • learn best practices

Where to learn Flutter basics?

I can only recommend what I've used myself:

What if I want more?

If you want Firebase integration, notifications, in-app purchases and more, you can get the Pro version here ($200-off discount lasts until end of October):

Get Your Scalable Flutter App PRO for $47 ($200 OFF)

Resources

Build your app icon in minutes (free): Icon Kitchen

CI/CD for mobile apps (free & paid): Codemagic

Want me to launch your MVP in 4 weeks (premium)? Go to App Launch Program

Need a Flutter Expert (paid)? Go to Flutter Devs Board

Feedback

Found an issue or want to request a feature? Open an issue

Have a question? Ask me on LinkedIn or Twitter.

About

A scalable Flutter app template that uses flutter_bloc and go_router. Save weeks of work for your next Flutter app πŸš€

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dart 92.2%
  • HTML 3.5%
  • Ruby 2.6%
  • Swift 1.3%
  • Other 0.4%