Provider MVVM的最佳实践,最适合新手学习的flutter开源项目

Overview

BaseFlutter

最适合新手学习的flutter开源项目,Provider MVVM的最佳实践

Getting Started

前言:
flutter作为新一代移动UI框架,有很多native不具备的优势,比如开发时热加载,可以立刻看到UI修改效果,提升开发效率, 而且同一套代码还可以在多端同时运行,确实节约开发成本,之前公司开始了TT语音的flutter迁移,所以学习了flutter,然 后开发了BaseFlutter开源项目,该项目使用了很多实际项目开发中需要用到了技术和第三方框架,而且做了很多基础封装,可 以直接拿到实际项目中使用,而且学习这个项目还可以帮助新手减降低学习难度,提供学习方向,实现flutter快速入门

使用的第三方框架

1. injectable
配合get_it框架,在编译时生成代码,实现依赖注入
2.dio
实现网络请求
3.get_it
实现依赖注入
4.retrofit
结合dio实现网络请求,编译时生成网络请求的代码
5.logger
日志打印
6.toast
吐司
7.event_bus
实现不同页面和组件的通信
8.json_serializable
结合json_annotation实现json数据序列化
9.extended_image
实现网络图片的加载,强大的官方 Image 扩展组件, 支持加载以及失败显示,缓存网络图片,缩放拖拽图片,绘制自定义效果等功能
10.webview_flutter
实现网页的加载
11.shared_preferences
简单的数据持久存储
12.pull_to_refresh
实现下拉刷新和分页加载
13.floor
数据库,使用类似于retrofit
14.flutter_swiper
图片轮播

使用的架构和基础封装

1.结合Provider实现MVVM架构,封装了BaseState,BaseStatefulWidget,BaseViewModel
2.结合模板方法模式,泛型,Mixin,依赖注入等方式,封装了大量重复的逻辑,简化了开发难度
3.Mixin类的封装:目前包含NavigatorMixin,ToastMixin,SharePreferenceMixin,EventBusMixin
4.DataBaseMixin基础Widget的封装:例如BottomDialog,CenterDialog,EnsureAndCancelDialog,
  LoadingDialog,PopupWindow,CommonWrap,LazyIndexedStack等等
5.BaseViewModel统一网络请求,统一发起网络请求,同时处理异常,loading

后期规划
1.路由,实现各模块,各业务的解耦
2.组件化
3.内存泄漏检测
4.埋点框架
5.各种炫酷动画
6.性能优化\

QQ交流群
群号码:770892444

You might also like...

Built_redux provider for Flutter.

flutter_built_redux built_redux bindings for Flutter. By creating a Widget that extends StoreConnector you get automatic subscribing to your redux sto

Dec 31, 2022

Liquidart is a Dart HTTP server framework for building REST APIs. Includes PostgreSQL ORM and OAuth2 provider. Revival of the abandoned AQUEDUCT project.

Liquidart is a Dart HTTP server framework for building REST APIs. Includes PostgreSQL ORM and OAuth2 provider. Revival of the abandoned AQUEDUCT project.

Liquidart is a modern Dart HTTP server framework. The framework is composed of libraries for handling and routing HTTP requests, object-relational map

Dec 27, 2022

An open source flutter ride-hailing app for learning purpose(Provider & Bloc)

citycab An open source ride hailing app with flutter. Getting Started This project is a starting point for a Flutter application. A few resources to g

Jan 2, 2023

Music player application for android. It's uses MVVM architecture and Provider & ValueNotifier state management.

Music player application for android. It's uses MVVM architecture and Provider & ValueNotifier state management.

music-player-flutter Flutter music player application which is my personal project published to play store. Project structures are as following,

Jul 10, 2022

A provider that passes EventBus down to all the widgets.

A provider that passes EventBus down to all the widgets.

Jul 9, 2022

A boilerplate project created in flutter using MobX and Provider

Boilerplate Project A boilerplate project created in flutter using MobX and Provider. Boilerplate supports both web and mobile, clone the appropriate

Jan 20, 2022

Surena store application , Create by Flutter with Provider statemanagement

surena_store_application A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you

Jul 6, 2022

Timer based on provider state manager

timer_provider Timer based on provider state manager Getting Started This project is a starting point for a Flutter application. A few resources to ge

Aug 10, 2022

Flutter State Management: Movie App with Provider, Riverpod, flutter_bloc & more

 Flutter State Management: Movie App with Provider, Riverpod, flutter_bloc & more

Flutter State Management: Movie App with Provider, Riverpod, flutter_bloc & more This reference project shows how to implement a (Netflix-inspired) mo

Dec 29, 2022

Timer based on provider state manager

timer_provider Timer based on provider state manager Getting Started This project is a starting point for a Flutter application. A few resources to ge

Nov 6, 2021

A new practical project made with Flutter and some native widgets, movie API, provider state and more.

A new practical project made with Flutter and some native widgets, movie API, provider state and more.

Flutter Movie App This project was created with Flutter and some native Widgets like SingleChildScrollView, Hero Animation, SliverAppBar, StreamBuilde

Jul 12, 2022

Provider support for overlay, make it easy to build toast and In-App notification.

overlay_support Provider support for overlay, make it easy to build toast and In-App notification. this library support ALL platform Interaction If yo

Jan 1, 2023

This is a simple client of Reddit built with MVVM and Provider powered by a custom OAuth2.0 login

👷 🔧 🔩 Flutter Starter Architecture (MVVM + Hive) My custom starter project for Flutter apps. I was looking for a simple way to build Flutter app in

Oct 26, 2022

To do and accomplishment app built with Flutter and Dart. Made use of Provider

Todioapp A todo and accomplishment app built with Flutter Getting Started This project is a starting point for a Flutter application. A few resources

Dec 10, 2022

With Bloc - Path Provider - Hydrated Bloc

With Bloc - Path Provider - Hydrated Bloc

Intro Custom Default Counter App on Flutter. The updated : Flutter Bloc / Cubit + Path Provider + Hydrated Bloc + Store Data using Hive Check the scre

Oct 30, 2021

A Flutter MVVM provider demo application.

A Flutter MVVM provider demo application.

Flutter MVVM + Provider Demo A Flutter MVVM provider demo application. Demo About It simply loads Posts data from API and render the posts on the scre

Oct 17, 2022

Coneectivity Service is for checking the internet connection using provider

Features Coneectivity Service is for checking the internet connection using provider. Installation Add the latest version of package to your pubspec.y

Nov 28, 2021

Yugioh Cards Sample App using MobX, Provider, and Chopper

Yugioh Cards Sample App using MobX, Provider, and Chopper

Yugioh Cards Sample App All data are collected from https://db.ygoprodeck.com/api-guide/. I apply MobX as state management for this app. At this time,

Dec 29, 2022

Easy to use, customizable and pluggable Theme Provider.

Easy to use, customizable and pluggable Theme Provider.

theme_provider Easy to use, customizable Theme Provider. This provides app color schemes throughout the app and automatically rebuilds the UI dynamica

Dec 10, 2022
Owner
null
A new practical project made with Flutter and some native widgets, movie API, provider state and more.

Flutter Movie App This project was created with Flutter and some native Widgets like SingleChildScrollView, Hero Animation, SliverAppBar, StreamBuilde

Paúl 4 Jul 12, 2022
With Bloc - Path Provider - Hydrated Bloc

Intro Custom Default Counter App on Flutter. The updated : Flutter Bloc / Cubit + Path Provider + Hydrated Bloc + Store Data using Hive Check the scre

Ihab Zaidi 1 Oct 30, 2021
Dart HTTP server framework for building REST APIs. Includes PostgreSQL ORM and OAuth2 provider.

Aqueduct is a modern Dart HTTP server framework. The framework is composed of libraries for handling and routing HTTP requests, object-relational mapp

Stable Kernel 2.4k Jan 5, 2023
Expenses tracker built with Flutter and Dart making use of Provider, Intl, Syncfusion Flutter Datepicker and more

expense_app A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if t

Atuoha Anthony 2 Dec 10, 2022
A mobile medicine reminder built with Flutter, Provider and BLoC pattern.

Mediminder An Offline Medicine Reminder Built with Flutter, Provider and BLoC pattern Key Features Homepage medicine list Homepage containing all the

null 231 Jan 3, 2023
Todo app - To-Do application using Provider and Shared Preferences

To-Do App To-Do application using Provider and Shared Preferences. Run Locally I

Ecem Bostancıoğlu 17 Oct 13, 2022
The Drawer Manager class has the ability to swap Scaffold body contents, using a custom provider

The Drawer Manager class has the ability to swap Scaffold body contents, using a custom provider. Open Drawer Hello, Flutter! Counter The MAC All Page

The Mobile Applications Community 2 Mar 18, 2022
Neha Tanwar 4 Feb 2, 2022
Note provider - Note App using Provider state management, Sqflite and Localization for two language Arabic and English.

note_provider Sqflite with provider statemanagement Getting Started This project is a starting point for a Flutter application. A few resources to get

Mohanned Anwar 0 Jan 1, 2022
Dusyeri provider task - Dusyeri provider task built using flutter

Düşyeri Provider Task https://github.com/alper-mf/dusyeri_provider_task/blob/7d1

null 1 May 9, 2022