Giter VIP home page Giter VIP logo

vedintech007 / ultimate-flutter-starter-setup Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 301 KB

Am putting together useful flutter project helper functions, packages and soo more. The goal is to avoid mistakes I made while starting my previous projects. Explore what i have and use to your satisfaction and feel free to contribute as well

Kotlin 0.21% Swift 2.60% Objective-C 0.06% Dart 26.40% CMake 28.32% C++ 33.47% C 2.14% HTML 2.77% Ruby 4.03%

ultimate-flutter-starter-setup's Introduction

Flutter Project Setup

Global folder structure

  • Common will contain commonly used widgets like loading indicators, dialogs, and any widget you use frequently on your modules.

  • Widgets fill contain high-level widget files like your wrapped function of [https://pub.dev/packages/flutter_form_builder] fields or a data table widget for example.

  • Utils will contain const variables you have created. These can be styles and design values. It can also contain functions you frequently use.

  • Themes will contain your themes created with official documentation: [https://docs.flutter.dev/cookbook/design/themes]

  • Controllers will contain controllers that you use globally in your modules or before starting the app.

  • Interceptors will contain for example a fetching interceptor or a route interceptor. I use Dio for data fetching so I create Dio’s interceptor there.

  • Endpoints will contain string URL functions that you use for data fetching. Using endpoints like this will make it quicker to update and see what endpoints you are using overall.

  • Models will contain JSON models you have created with official documentation here: [https://docs.flutter.dev/development/data-and-backend/json]

  • Services will contain functions that fetch from API.

    • Both services and models must be in a global folder in a big app. The reason for this is you can use a service both in the profile module and home module etc.

    • If you create models and services per module it will get complicated in the long run.

Modules folder structure

  • Controllers will contain controls (or view models. I am using GetX which is why I named them “Controllers”) you have created. It can be a GetX controller or other state management packages you have used.

  • The widgets folder will contain widgets that we will use on our view. I always advise you to cut chunks of your view into smaller widgets whenever possible.

  • And then there is your view. Which will be your view.. amazing isn’t it? It should not be more than 300 lines of code max.

    • Business logic should be handled in your controllers. Widgets in your view should be separated by files and then recalled on your view.

So I don't complicate stuff here, I will put the contents guide in the README.md file in their respective folders, and I will try to keep it simple

structure idea is from Umut Arpat a senior flutter developer

ultimate-flutter-starter-setup's People

Contributors

vedintech007 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.