GetX库
DI模式
依赖注入是一个很棒的设计模式,它可以让我们消除元素之间僵化的依赖关系,并使应用程序更具灵活性,易于扩展和维护。
在该项目中,我们使用插件getX来实现DI,并且我们还定义了类,以便您可以轻松地在DI层中实现DI。
路由
我们使用GetX路由管理来管理路由,并使用Getx bindings为该路由提供依赖。
网络。
* Project can use retrofit to work with the alternative network for http.
* Retrofit is pre-installed in the "ApiModule.dart". You can customize it here
* All interceptors are defined in the /configuration/lib/network/interceptor/* class
* To work with Certificate, please refer to the "/configuration/lib/network/http_overrides.dart" class, with the default the project accept badCertificate
环境设置。
教程链接: https://www.chwe.at/2020/10/flutter-flavors/
* All flavor environments are installed in the "/configuration/lib/environment/buid_config.dart" class.
* Basically we are defining 4 development environments: development, staging, preprod and release.
* Run App
您可以使用以下命令运行应用程序 仅限安卓
## development: flutter run -t lib/main_dev.dart --debug --flavor dev
## staging: flutter run -t lib/main_stag.dart --debug --flavor stag
## preprod: flutter run -t lib/main_prod.dart --debug --flavor prod
构建应用
您可以使用以下命令构建应用程序
用于安卓
## development: flutter build apk -t lib/main_dev.dart --flavor dev
## staging: flutter build apk -t lib/main_stag.dart --flavor stag
## preprod: flutter build apk -t lib/main_prod.dart --flavor prod
用于iOS (更新中…)
资源
* All resources (images, fonts, videos, ...) must be placed in the assets class
* Before using them, please declare the path in constants class and the suffix of the class to be type_provide (image_provide.dart)
JSON解析/序列化
本项目正在实现json_serializable。
它使用build_runner来生成文件。如果您对这些文件进行了更改,则需要使用build_runner重新运行生成器
flutter pub run build_runner build
本地化
使用此库处理多语言。请遵循本指南来理解和配置语言文件
隐藏生成的文件
为了隐藏生成的文件,请导航到 Android Studio -> Preferences -> Editor -> File Types,然后在ignore files and folders部分粘贴以下行
*.inject.summary;*.inject.dart;*.g.dart;
在 Visual Studio Code 中,导航到 Preferences -> Settings 并搜索 Files:Exclude。添加以下模式
**/*.inject.summary
**/*.inject.dart
**/*.g.dart
结束
_oo0oo_
o8888888o
88" . "88
(| -_- |)
0\ = /0
___/`---'\___
.' \\| |'.
/ \\||| : |||\
/ _||||| -:- |||||- \
| | \\\ - /| |
| \_| ''\---/'' |_/ |
\ .-\__ '-' ___/-. /
___'. .' /--.--\ `. .'___
."" '< `.___\_<|>_/___.' >' "".
| | : `- \`.;`\ _ /`;.`/ - ` : | |
\ \ `_. \_ __\ /__ _/ .-` / /
=====`-.____`.___ \_____/___.-`___.-'=====
`=---='
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
BuddhaBlessings NoBUG
