Git Product home page Git Product logo

dev-adnani / flutter-mvvm-template Goto Github PK

View Code? Open in Web Editor NEW
12.0 1.0 5.0 275 KB

This Flutter project template uses Provider for state management and follows the MVVM architectural pattern. It provides a structured foundation for building scalable and maintainable Flutter applications

Kotlin 0.18% Swift 2.71% Objective-C 0.06% Dart 26.87% CMake 29.37% C++ 35.70% C 2.24% HTML 2.88%
code-templates flutter flutter-apps flutter-architecture flutter-design-patterns flutter-development flutter-projects flutter-state-management flutter-template flutter-ui

flutter-mvvm-template's Introduction

Flutter MVVM Template

This is a Flutter project template that follows the MVVM (Model-View-ViewModel) architectural pattern. It provides a starting point for building scalable and maintainable Flutter applications using the Provider state management library.

Project Structure

The project structure is organized as follows:

lib
├── data
│   ├── local
│   ├── remote
│   │   ├── network
│   │   └── response
│   └── app.exceptions.dart
├── models
├── repository
├── res
│   ├── colors
│   ├── dimensions
│   ├── app.context.extension.dart
│   └── resources.dart
├── utils
├── view
│   ├── screens
│   └── shared
├── view_model
└── main.dart
  • lib/data: Contains data-related classes and modules.

    • local: Contains local data storage implementations.
    • remote: Contains remote data-related classes and modules.
      • network: Contains network-related classes and modules.
      • response: Contains response model classes for network requests.
    • app.exceptions.dart: Provides custom exception classes for the application.
  • lib/models: Contains data models used throughout the application.

  • lib/repository: Contains the repository layer, which acts as a mediator between the data layer and the view models.

  • lib/res: Contains resource-related files such as colors, dimensions, and context extension.

    • colors: Defines color constants for the application.
    • dimensions: Contains dimension constants used for layout and styling.
    • app.context.extension.dart: Contains extension methods for the BuildContext class.
    • resources.dart: Imports and exports all the resource files for easy access.
  • lib/utils: Contains utility classes and functions used across the application.

  • lib/view: Contains the UI-related files.

    • screens: Contains individual screens or pages of the application.
    • shared: Contains shared UI components used across multiple screens.
  • lib/view_model: Contains the view models that handle the business logic for each screen.

  • lib/main.dart: Entry point of the application.

State Management

This project uses the Provider package for state management. Provider is a popular state management solution for Flutter that provides a simple and efficient way to manage and share state between different parts of the application.

Getting Started

To get started with this template:

  1. Clone or download the repository: git clone https://github.com/Dev-Adnani/flutter-mvvm-template.git.
  2. Open the project in your preferred Flutter development environment.
  3. Run flutter pub get to fetch the project dependencies.
  4. Update the necessary configuration files, such as package name and app icon.
  5. Start building your application by modifying or adding files in the appropriate directories.

License

This project is licensed under the MIT License. Feel free to use it as a template for your own Flutter projects.

Acknowledgments

This template is inspired by and adapted from various Flutter project structures and MVVM architecture patterns.

Please refer to the Contributing Guidelines for more information on how to contribute to this project.

Happy coding!

flutter-mvvm-template's People

Contributors

dev-adnani avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.