flutter_getx_template
一个用于启动 Flutter GetX 项目的基础样板模板。已实现 GetX、Dio、MVVM、get CLI、本地化、分页等功能。
- 星标
- 442
- 复刻
- 155
- 最近推送(UTC)
- 2024年1月11日
- 项目状态
- 未归档
原始 README
以下为英文项目原文快照,最新内容请访问 GitHub。
Flutter GetX Template (GetX, Dio, MVVM)
This Flutter Template using GetX package for State management, routing and Dependency Injection (bindings). We are using MVVM (Model View ViewModel) architectural pattern here. For network call we are using Dio package. We followed the recommended folder structure of GetX and used Get CLI command line tool for creating the folder structure.
Architecture of this project: MVVM
MVVM (Model View ViewModel) is one of the most popular architectural pattern for Android App development. Basically this pattern separates User interface from business-logic and data-logic. So that it's divided into three layers: Model layer, View layer and View model layer. Let's explore it more deeply.
ViewModel: At first let's talk about ViewModel. Actually view model is a controller where we implement our business logics. It receives the data from the model and process the data according to business logic and pushed into the live data observers which is observing by view.
View: View is the collections of widgets like Text, Image, Dropdown etc. Which will be displayed to the users. Even it controls the user input. When it needs any data it command the view model (In this project it's controller) for data and observe the response. Till then it may display a loader to the user.
Model: Model is basically backend logic. It controls the data source.
To configure and run this project check here
You will find at above link step by step instructions with screenshots.
run this project by command line
Dev: flutter run --flavor dev lib/main_dev.dart
Prod: flutter run --flavor prod lib/main_prod.dart
How to update app information and continue development for your own project?
- Rename root folder name
- Update project name and description from pubspec.yaml.
- Update app launcher name and icon. Reference
- Update your app's package name by running this command:
flutter pub run change_app_package_name:main your_package_name
How was this project developed?
- Run get cli command to create project in the required directory:
get create project - Create
main_viewby running this command:get create page:mainand so on...
使用的依赖
依赖清单 19 项
- flutter
{"sdk":"flutter"} - animations
2.0.8 - cached_network_image
3.3.0 - cupertino_icons
1.0.6 - dio
5.3.3 - font_awesome_flutter
10.6.0 - flutter_localizations
{"sdk":"flutter"} - fluttertoast
8.2.2 - flutter_svg
2.0.8 - get
4.6.6 - intl
0.18.1 - logger
2.0.2+1 - pretty_dio_logger
1.3.1 - shared_preferences
2.2.2 - flutter_test开发依赖
{"sdk":"flutter"} - flutter_lints开发依赖
2.0.2 - analyzer开发依赖
5.13.0 - dart_code_metrics开发依赖
any - change_app_package_name开发依赖
1.1.0
所在榜单
如何选择适合项目的代码仓?
先按使用场景筛选,再比较项目活跃情况,最后到原始仓库核对使用要求。
- 通过仓库名、作者或描述搜索,再按技术分类缩小范围。
- 结合星标、复刻与最近推送比较项目;星标反映社区关注,不代表质量保证。
- 使用前在 GitHub 核对 README、许可证与 Issues。
来源与维护
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗
