Template for large or scaleable Flutter project

Overview

Template Project

See example usage on Youtube

Config

config folder contains the following folders:

  • routes : The route folder contains all the files which are based on the application screens navigation code
  • themes : If our application supports light and dark theme and these themes are custom themes then need to create two files light_theme.dart, dark_theme.dart where we will be adding all the colors which are needed for each widget type.

Constans

Here are the following constants which are static throughout the applications :

  • api_path.dart : When using REST API service in dart then we can store all the API endpoints in a separate file api_path.dart
  • assest_path.dart : Although we have described the assets path in pubspec.yaml but to use that asset in an application we need to give there relative path in any widgets. If we add all the assets relative path in one file then it will be easy for us to get all the paths and update the path if required in the future.

Features

Let's take the example with module dashboard in the application which contains the following folders: Untitled

  • Models : This folder contains the data models which need to be shown on the dashboard screen.
  • Bindings : constains file for instance controller
  • Controllers: contains state management. learn Getx state management
  • Views : Components folder contains certain widget components that will be organized in the file dashboard_screen.dart , Screen folder consists of all the screens UI widgets that will be visible to the user.

Shared Components

In a large scale application, we need to make more customized widgets rather than flutter default widgets. Suppose we need to make use of our own custom RaisedButton, FlatButton, OutlineButton, Divider, CircularLoader, etc which we can use throughout our application then that kind of customization widgets we can add inside the folder Shared Components

Utils

Utils folder contains the helpers, services, UI utils, mixins which are used throughout the application

  • Helpers : In many scenarios, we need to write code multiple times for the same thing like converting the every word first characters to be uppercase usually used in showing titles for any other widgets, etc. This kind of code can be made common to reduce the redundancy and add that code in helpers files which are present in lib/utils/helpers/text_helper.dart. text_helper.dart will contain all the code which are required to convert the String to show in a Text widget.
  • Mixins : is a class that contains methods for use by other classes without having to be the parent class of those other classes.” In other words, mixins are normal classes from which we can borrow methods(or variables) from without extending the class. In the application, we can make different mixins like validation_mixins.dart, orientation_mixins.dart
  • Services : We will be creating a different kind of service files in the folder lib/utils/services. All the services will be singleton classes.
    1. local_storage_service.dart : In this file, we write all the code needed to store and get data from the local storage using the plugin shared_preferences. In this file, there will be getters and setters for each and every data to be stored in the local storage.
    2. rest_api_service.dart : We do call the rest API to get, store data on a remote database for that we need to write the rest API call at a single place and need to return the data if the rest call is a success or need to return custom error exception on the basis of 4xx, 5xx status code. We can make use of http or dio package to make the rest API call in the flutter
    3. native_api_service.dart : We use multiple packages to access the native services like Camera, Photo Gallery, Location, etc for that we need to write code in a separate file which we can be used from multiple places throughout the application

Other

Reference

You might also like...

Structured and Organized Flutter (ANDROID+WEB) template project using Redux architecture and Retrofit rest package

flutter_redux_template A new Flutter project. JSON Models classes need this lines to json generator: part 'foo.g.dart'; //on imports factory Foo.from

Apr 11, 2022

Flutter Project Template

Flutter Project Template

Flutter Project Template This template is currently under developemnt. Features 💪 Enterprise Ready, build robust, maintainable and testable real apps

Feb 23, 2022

The project of the empty template with Flutter has built the basic framework to realize the functions of internationalization, theme peeling etc.

The project of the empty template with Flutter has built the basic framework to realize the functions of internationalization, theme peeling etc.

flutter-bloc-app-template 🤖 The project of the empty template with Flutter has built the basic framework to realize the functions of internationaliza

Dec 31, 2022

Flutter project template with BloC architecture. Implemented many feature as stated in README

Flutter project template with BloC architecture. Implemented many feature as stated in README

Flutter Project Template Using BloC Implementations Theme switching Advanced Routing Bloc Observer for debugging Hydrated Cubit for holding value even

Dec 10, 2022

For creating custom flutter project from template

For creating custom flutter project from template A standalone solution to issue flutter/flutter#15279 Installation If you want to use flutter_create

Nov 21, 2022

Flutter project template with BloC and repository pattern.

Flutter project template with BloC and repository pattern.

Dec 10, 2022

Clean architecture template project for new flutter applications.

Clean architecture template project for new flutter applications.

clean_template Clean architecture template project for new flutter applications. Implemented app logic RestClient - rest API client-server networking

Jul 27, 2022

A Template Project for Flutter.

Flutter Boilerplate A Template Project for Flutter. Getting Started 🚀 This project contains 3 flavors: development staging production To run the desi

Nov 21, 2022

This is template toolkit fasten your project setup within a minute. The toolkit is based on MVC+S structure.

This is template toolkit fasten your project setup within a minute. The toolkit is based on MVC+S structure.

BWeird Flutter Toolkit! Hi! From a Weirder Flutter has been great on mobile development and I took this opportunity to make it even greater with templ

Aug 22, 2021
Owner
Firgia
Firgia
GetX Architecture for large scale project, This project include - pagination, pull to refresh, localization, network call and advance error handling

GetX Architecture for large scale project, This project include - pagination, pull to refresh, localization, network call and advance error handling

Wai Han Ko 5 Nov 29, 2022
A simple dart package to convert large numbers to a human readable format. 1278 to 1.2K instead, for example.

A simple dart package to convert large numbers to a human readable format. 1278 to 1.2K instead, for example. Features Represents large numbers in ter

Rohit V 1 Oct 8, 2022
Planto - Planto app mainly targets the farmers whether large scale or small scale

planto Inspiration Planto has been developed for the farming sector. In India, f

Amit Singh 1 Nov 2, 2022
Flutter getx template - A Flutter Template using GetX package for State management, routing and Dependency Injection

Flutter GetX Template (GetX, Dio, MVVM) This Flutter Template using GetX package

Tareq Islam 6 Aug 27, 2022
meg4cyberc4t 11 Oct 24, 2022
Flutter template project - Simple ToDo app with scalable project structure.

Flutter Template Flutter template project - A simple TODO list app. This template provides simple UI and scalable project structure that goes beyond t

Web Factory LLC 128 Nov 21, 2022
Starting template for a new Flutter project. Using clean architecture + Riverpod.

flutter_project_template_riverpod Installation Add Flutter to your machine Open this project folder with Terminal/CMD Ensure there's no cache/build le

Bahri Rizaldi 39 Dec 27, 2022
Flutter empty template to start your project.

flutter_starter Flutter empty template to help you start your project. PACKAGES Packages I've used Getx Shimmer Shared Preferences Gap Flutter Localiz

martinoyovo 2 Dec 2, 2021
A basic boilerplate template for starting a Flutter GetX project. GetX, Dio, MVVM, get CLI, Localization, Pagination etc are implemented.

Flutter GetX Template (GetX, Dio, MVVM) This Flutter Template using GetX package for State management, routing and Dependency Injection (bindings). We

Hasan Abdullah 214 Jan 9, 2023
Project-x2 - A Flutter E-Commerce starter template that bootstraps development of your mobile application

Flutter E-Commerce UI KIT A powerful Flutter E-Commerce starter template that bo

null 1 Apr 7, 2022