GitHub Workflow Status (branch) GitHub forks GitHub stars GitHub watchers GitHub contributors GitHub last commit GitHub top language

Flutter Healsense 应用

Frame 1

说明

本应用程序的所有代码结构均为开源,除GOOGLE_MAPS_API_KEY。由于这是一个正在生产中的应用程序,您必须获取GOOGLE_MAPS_API_KEY,在项目顶部创建一个.env文件,并将密钥包含在那里才能成功运行该应用程序。

支持空安全

项目架构(DDD架构方法)

1. 为什么

* We want to determine what types of database that we use for storage (might want to change it later on)
* We want to adhere to SOLID principles since we are using OOP for this project.
* We want to ensure that UI layers do not care what is going on at the data layer at all.
* We might want to separate each layer into different packages.
2. 应用 – 依赖注入 – 领域 – 基础设施 – 本地化 – 展示。
3. 展示层包含

* Pages
* Widgets
4. 领域层

* Core (Value objects, Failures)
* Repositories interface
* Entities
* Typically one function, but can be more if functions are related.
* Remember, one class has one responsibility only.
5. 基础设施层

* Core
* Data Source
    * locals (Database)
    * remotes (API)
* Repositories (Implementation from Domain layer)
* Models
* Services
6. 应用层

* State Management solution (Riverpod Binding Framework)
* States according to that framework
* Notifiers according to that framework
7. 关于各层的更多见解

DDD-Flutter-Diagram-v3

依赖注入模式

依赖注入是一个很棒的设计模式,它可以让我们消除元素之间僵化的依赖关系,并使应用程序更具灵活性,易于扩展和维护。在该项目中,我们使用插件injectableget_it来实现依赖注入,我们还定义了类,以便您可以轻松地在DI层中实现依赖注入

Routes

项目具有预定义的命名路由(Go Router)

资源

  * All resources (images, fonts, videos, ...) must be placed in the assets class

入门

获取依赖项并生成必要的文件。

我们将处理为您的新用户引导生成所需文件!

本地化

使用此库处理多语言。请遵循本指南来理解和配置语言文件


您已经正确地完成了所有步骤,并且我保证该项目将对您学习 Flutter 的进度产生重大影响

GitHub

查看 Github