Giter Club home page Giter Club logo

sunqihui222 / mood-example Goto Github PK

View Code? Open in Web Editor NEW

This project forked from amoshuke/mood-example

0.0 1.0 0.0 35.48 MB

🐦 Flutter3.0 心情记录 样例工程-国际化 i18n、uni小程序、深色模式、多主题、本地数据管理、路由管理、状态管理(MVVM)、集成测试、图表统计、Excel导入导出……

License: BSD 3-Clause "New" or "Revised" License

JavaScript 4.61% Objective-C 0.01% Kotlin 0.84% Dart 92.30% CSS 0.22% Swift 0.10% HTML 1.92%

mood-example's Introduction

Preview1


Logo Mood Example

Mood-Example v1.4.8 Flutter v3.1 Dart v2.17.1 BSD-3-Clause License

情绪记录 样例工程
管理自己的情绪,记录当下所见所想,以及其他实验室功能
运用 Flutter 的实践工程,主要目的是学习、实践。

注意:由于是学习实践工程,所以重点在于学习,许多业务逻辑可能并不符合现实。
Emoji因设备缘故,会存在不同样式。

🌏 相关网站

Flutter 官网(中文):https://flutter.cn/
Flutter 官网(英文):https://flutter.dev/
Packages (原始站点) :https://pub.dev/
Packages (**镜像) :https://pub.flutter-io.cn/

⭐ 功能

  • 国际化 i18n
  • 多主题
  • 深色模式
  • 本地数据管理
  • 路由管理
  • 状态管理(MVVM)
  • 集成测试
  • 情绪记录
  • 图表统计
  • Excel 导入导出
  • Web 访问
  • 本地通知
  • 动画
  • 实验室(占用 APP 大部分包体积)
    • uniapp 小程序(UniMPSDK v3.4.7)
    • 3D 城市(obj 格式)
      ……
  • 隐私解锁
  • 无障碍支持
    ……

📱 测试运行环境

环境 支持版本
Android 最低:Android 5.0 (API 21)
IOS 未测试

🛠️ 开发环境

基本环境

[√] Flutter (Channel stable, 3.0.1, on Microsoft Windows [版本 10.0.22000.613], locale zh-CN)
[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.1.3)
[√] Android Studio (version 2021.2)
[√] VS Code (version 1.67.2)

国际化环境支持

安装编辑器插件:Flutter Intl

Visual Studio Code: Flutter Intl
IntelliJ / Android Studio: Flutter Intl

# 插件指令

# 初始化
Flutter Intl: Initialize

# 添加 Locale
Flutter Intl: Add locale

# 删除 Locale
Flutter Intl: Remove locale

等等...

使用 Flutter Intl: Add locale 输入 国际化(i18n)地区对照语言码,如简体中文:zh_CN,插件会自动在 lib/l10n 目录下生成对应的 arb 文件,我们只需要在 arb 文件中进行翻译。
arb 翻译工作完成后,将对应的语言添加到 lib/config/language.dart 内。
即可 适配设备首选语言 以及 在应用语言设置内进行切换

├── lib
│   ├── config
│   │   └── language.dart   # 语言配置
│   ├── generated           # intl 语言包生成的文件夹(不用编码,使用 Flutter Intl 插件自动生成)
│   ├── l10n                # intl 语言包
│   │   └──intl_zh_CN.arb   # 如 简体中文:zh_CN
......

IOS 支持语言本地化还需要在 ios/Runner/Info.plist 进行如下编辑。

<key>CFBundleLocalizations</key>
<array>
    <string>en</string>
    <string>zh_CN</string>
    ...
</array>

🎉 启动

开发环境支持的情况下

# 拷贝项目
$ git clone https://github.com/AmosHuKe/Mood-Example.git

# 获取依赖
$ flutter pub get

# 启动项目 或 相关IDE启动
$ flutter run

# 更多启动模式
$ flutter run --debug/release/profile/test

# 清理构建缓存
$ flutter clean

# 集成测试
$ flutter test integration_test/app_test.dart

📑 项目结构

├── android                                         # Android 工程文件 
│   ├── app                       
│   │   ├── libs                                    # 包含 UniMPSDK 依赖库
│   │   └── src 
│   │   │   └── main                  
│   │   │   │   ├── assets                          # 包含 UniMPSDK 内容
│   │   │   │   │   ├── apps                        # 包含 UniMPSDK 的 uniapp 小程序
│   │   │   │   │   ├── data                        # 包含 UniMPSDK 内容
│   │   │   │   │   ├── uni-jsframework-vue3.js     # UniMPSDK
│   │   │   │   │   └── uni-jsframework.js          # UniMPSDK
│   │   │   │   └── kotlin                          
│   │   │   │   │   └── com                      
│   │   │   │   │   │   └── example    
│   │   │   │   │   │   │   └── moodexample
│   │   │   │   │   │   │   │   └── MainActivity.kt # Flutter 的 Android 默认入口
├── assets                                          # 静态资源文件
├── build                                           # 编译或运行后产物
├── integration_test                                # 集成测试
│   └── app_test.dart                               # 集成测试入口 用例
├── ios                                             # IOS 工程文件
├── lib                                             # 工程相关文件(主要编码)
│   ├── common                                      # 公共相关
│   │   ├── local_notifications.dart                # 本地通知
│   │   ├── utils_intl.dart                         # 国际化工具
│   │   └── utils.dart                              # 工具
│   ├── config                                      # 配置
│   │   ├── language.dart                           # 语言配置
│   │   └── multiple_themes.dart                    # 多主题配置
│   ├── db                                          # 数据存储相关
│   │   ├── database                                # sqflite 数据表配置
│   │   ├── db.dart                                 # sqflite 数据库相关
│   │   └── preferences_db.dart                     # shared_preferences 数据相关
│   ├── generated                                   # intl 语言包生成的文件夹(不用编码,使用 Flutter Intl 插件自动生成)
│   ├── l10n                                        # intl 语言包
│   ├── models                                      # 数据模型
│   ├── services                                    # 数据服务
│   ├── themes                                      # 主题相关
│   │   ├── multiple_themes_mode                    # 多主题配色
│   │   │   └── theme_default.dart.dart             # 多主题默认配色
│   │   └── app_theme.dart                          # 主题基础
│   ├── view_models                                 # 业务逻辑
│   ├── views                                       # 视图
│   ├── widgets                                     # 组件相关
│   ├── application.dart                            # 主应用
│   ├── home_screen.dart                            # 主应用导航相关
│   ├── main.dart                                   # 主应用入口
│   └── routes.dart                                 # 路由管理
├── test                                            # 测试
├── .gitignore                                      # Git 提交仓库忽略文件配置
├── .metadata                                       # 当前 workspace 配置记录
├── analysis_options.yaml                           # Dart 语言代码规范
├── pubspec.lock                                    # 依赖生成的文件
└── pubspec.yaml                                    # 核心配置文件(项目配置、依赖等)

🖼️ Illustration

style--woolly
Illustration by Svetlana Tulenina from Ouch!

🎨 Design

Packages 许可证

感谢开源

License 许可证

BSD-3-Clause License
Open sourced under the BSD-3-Clause license.
根据 BSD-3-Clause 许可证开源。
© AmosHuKe

mood-example's People

Contributors

amoshuke avatar

Watchers

James Cloos 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.