├── .gitignore
├── .metadata
├── LICENSE
├── README.md
├── android
├── .gitignore
├── app
│ ├── build.gradle
│ └── src
│ │ ├── debug
│ │ └── AndroidManifest.xml
│ │ ├── main
│ │ ├── AndroidManifest.xml
│ │ ├── kotlin
│ │ │ └── com
│ │ │ │ └── sia
│ │ │ │ └── timefly
│ │ │ │ └── MainActivity.kt
│ │ └── res
│ │ │ ├── drawable
│ │ │ ├── launch_background.xml
│ │ │ └── notification.png
│ │ │ ├── mipmap-hdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-mdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ ├── ic_launcher.png
│ │ │ ├── store_1024pt.png
│ │ │ └── temp.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ └── ic_launcher.png
│ │ │ └── values
│ │ │ └── styles.xml
│ │ └── profile
│ │ └── AndroidManifest.xml
├── build.gradle
├── gradle.properties
├── gradle
│ └── wrapper
│ │ └── gradle-wrapper.properties
├── settings.gradle
└── settings_aar.gradle
├── assets
└── images
│ ├── aquarium-水族馆.png
│ ├── badminton-player-羽毛球.png
│ ├── basketball-篮球.png
│ ├── bianji.svg
│ ├── bumblebee-熊峰.png
│ ├── butterfly-蝴蝶.png
│ ├── calendar_view_day.svg
│ ├── calendar_view_month.svg
│ ├── calendar_view_week.svg
│ ├── cat-footprint-猫抓.png
│ ├── cute-hamster-可爱仓鼠.png
│ ├── cycling-自行车.png
│ ├── dinosaur-egg-龙宝宝.png
│ ├── dog-狗.png
│ ├── dove-鸽子.png
│ ├── duigou.svg
│ ├── exercise-运动.png
│ ├── fanhui.svg
│ ├── fishing-钓鱼.png
│ ├── flamingo-火烈鸟.png
│ ├── guanbi.svg
│ ├── habit_check.svg
│ ├── icon_contect.svg
│ ├── icon_fivestar.svg
│ ├── icon_jiaohuan.svg
│ ├── icon_theme.svg
│ ├── icon_today.svg
│ ├── jia.svg
│ ├── jian.svg
│ ├── jiaohuan.svg
│ ├── jump-rope-跳绳.png
│ ├── navigation_left.svg
│ ├── navigation_right.svg
│ ├── parrot-鹦鹉.png
│ ├── pilates-普拉提.png
│ ├── ping-pong-乒乓球.png
│ ├── skateboard-滑板.png
│ ├── swan-天鹅.png
│ ├── tennis-racquet-网球.png
│ ├── time.svg
│ ├── treadmill-跑步机.png
│ ├── user_icon.jpg
│ ├── wancheng.svg
│ └── zhouqi.svg
├── fonts
├── MaShanZheng-Regular.ttf
├── Montserrat-Bold.ttf
└── Montserrat-Regular.ttf
├── ios
├── .gitignore
├── Flutter
│ ├── AppFrameworkInfo.plist
│ ├── Debug.xcconfig
│ └── Release.xcconfig
├── Podfile
├── Podfile.lock
├── Runner.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ ├── IDEWorkspaceChecks.plist
│ │ │ └── WorkspaceSettings.xcsettings
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── Runner.xcscheme
├── Runner.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ ├── IDEWorkspaceChecks.plist
│ │ └── WorkspaceSettings.xcsettings
└── Runner
│ ├── AppDelegate.swift
│ ├── Assets.xcassets
│ ├── AppIcon.appiconset
│ │ ├── Contents.json
│ │ ├── Icon-App-1024x1024@1x.png
│ │ ├── Icon-App-20x20@1x.png
│ │ ├── Icon-App-20x20@2x.png
│ │ ├── Icon-App-20x20@3x.png
│ │ ├── Icon-App-29x29@1x.png
│ │ ├── Icon-App-29x29@2x.png
│ │ ├── Icon-App-29x29@3x.png
│ │ ├── Icon-App-40x40@1x.png
│ │ ├── Icon-App-40x40@2x.png
│ │ ├── Icon-App-40x40@3x.png
│ │ ├── Icon-App-60x60@2x.png
│ │ ├── Icon-App-60x60@3x.png
│ │ ├── Icon-App-76x76@1x.png
│ │ ├── Icon-App-76x76@2x.png
│ │ └── Icon-App-83.5x83.5@2x.png
│ └── LaunchImage.imageset
│ │ ├── Contents.json
│ │ ├── LaunchImage.png
│ │ ├── LaunchImage@2x.png
│ │ ├── LaunchImage@3x.png
│ │ └── README.md
│ ├── Base.lproj
│ ├── LaunchScreen.storyboard
│ └── Main.storyboard
│ ├── Info.plist
│ └── Runner-Bridging-Header.h
├── lib
├── add_habit
│ ├── edit_name.dart
│ ├── habit_edit_page.dart
│ ├── icon_color.dart
│ └── modify_change_dialog.dart
├── all_habits
│ ├── all_habit_item_view.dart
│ ├── all_habit_list_view.dart
│ └── all_habits_screen_2.dart
├── app_theme.dart
├── blocs
│ ├── bloc_observer.dart
│ ├── habit
│ │ ├── habit_bloc.dart
│ │ ├── habit_event.dart
│ │ └── habit_state.dart
│ ├── note_bloc.dart
│ ├── record_bloc.dart
│ ├── theme
│ │ ├── theme_bloc.dart
│ │ ├── theme_event.dart
│ │ └── theme_state.dart
│ └── user_bloc.dart
├── db
│ └── database_provider.dart
├── detail
│ ├── detail_calender_view.dart
│ ├── habit_detail_page.dart
│ └── habit_detail_views.dart
├── habit_progress
│ ├── habit_progress_screen.dart
│ ├── progress_rate_views.dart
│ └── week_month_chart.dart
├── home_screen.dart
├── login
│ └── login_page.dart
├── main.dart
├── mine
│ ├── change_theme_screen.dart
│ ├── mine_screen.dart
│ ├── mine_screen_views.dart
│ └── settings_screen.dart
├── models
│ ├── complete_time.dart
│ ├── habit.dart
│ ├── habit_color.dart
│ ├── habit_color2.dart
│ ├── habit_icon.dart
│ ├── habit_list_model.dart
│ ├── habit_peroid.dart
│ └── user.dart
├── notification
│ └── notification_plugin.dart
├── one_day
│ ├── habit_check_view.dart
│ ├── habit_list_view.dart
│ ├── lol_words.dart
│ ├── one_day_normal_view.dart
│ ├── one_day_rate_view.dart
│ └── one_day_screen.dart
├── test.dart
├── utils
│ ├── date_util.dart
│ ├── flash_helper.dart
│ ├── habit_util.dart
│ ├── hex_color.dart
│ ├── list_utils.dart
│ ├── pair.dart
│ ├── path_util.dart
│ ├── system_util.dart
│ └── uuid.dart
└── widget
│ ├── appbar
│ ├── curves.dart
│ ├── fluid_button.dart
│ ├── fluid_icon.dart
│ ├── fluid_icon_data.dart
│ └── fluid_nav_bar.dart
│ ├── calendar_view.dart
│ ├── circle_progress_bar.dart
│ ├── clip
│ └── bottom_cliper.dart
│ ├── custom_edit_field.dart
│ ├── float_modal.dart
│ └── tab_indicator.dart
├── pubspec.lock
├── pubspec.yaml
└── test
└── widget_test.dart
/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 |
12 | # IntelliJ related
13 | *.iml
14 | *.ipr
15 | *.iws
16 | .idea/
17 |
18 | # The .vscode folder contains launch configuration and tasks you configure in
19 | # VS Code which you may wish to be included in version control, so this line
20 | # is commented out by default.
21 | #.vscode/
22 |
23 | # Flutter/Dart/Pub related
24 | **/doc/api/
25 | **/ios/Flutter/.last_build_id
26 | .dart_tool/
27 | .flutter-plugins
28 | .flutter-plugins-dependencies
29 | .packages
30 | .pub-cache/
31 | .pub/
32 | /build/
33 |
34 | # Web related
35 | lib/generated_plugin_registrant.dart
36 |
37 | # Symbolication related
38 | app.*.symbols
39 |
40 | # Obfuscation related
41 | app.*.map.json
42 |
43 | # Exceptions to above rules.
44 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
45 |
--------------------------------------------------------------------------------
/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: 2ae34518b87dd891355ed6c6ea8cb68c4d52bb9d
8 | channel: stable
9 |
10 | project_type: app
11 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021 YaTang
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # timefly -- Checkio
2 |
3 | How time flies. 时光荏苒。
4 |
5 | ## 就是想做一个真正喜欢的APP而非demo!!!
6 | 这是一个花了半年业余时间做的一款习惯打卡APP,吸取了市面上很多产品经验。
7 | - 随意定制跟踪周期
8 | - 完成度的报表提示
9 | - 流畅炫酷的动画体验
10 |
11 | ### 主要内容
12 | - 首页展示今天需要完成的习惯
13 | - 所有习惯页面展示所有习惯,点击可以展示当月的完成情况
14 | - 进度页面,有周和月的周期选择,了解在时间范围内完成度情况
15 | - 我的页面,主要是设置,进行主题修改等
16 |
17 | ### 下载Release包体验极致动画效果
18 |
19 | 
20 |
21 |
22 |
23 | ### 技术栈
24 | - 请查看yaml文件三方依赖
25 |
26 | ### 感谢
27 | - 吸取了很多开源动画例子,这就是Flutter带给我的美妙的旅程,感谢那些无私奉献的大佬(笔芯)
28 | - [reflectly](https://reflectly.app/)
29 | - [flutter_vignettes](https://github.com/gskinnerTeam/flutter_vignettes)
30 | - [Best-Flutter-UI-Templates](https://github.com/mitesh77/Best-Flutter-UI-Templates)
31 |
32 |
33 |
34 | # 一些截图
35 | ## Home
36 | https://user-images.githubusercontent.com/33898039/136545254-3be9630f-9fff-4331-b54d-dec6269c0bda.mp4
37 |
38 |
39 | ## all habits
40 |
41 | https://user-images.githubusercontent.com/33898039/136545286-ea9d0056-e5c8-4428-bae6-ec1ae925799e.mp4
42 |
43 |
44 | ## progress
45 |
46 |
47 | https://user-images.githubusercontent.com/33898039/136545335-6ec83e6c-2f04-4fbd-a33d-b274e40d89cc.mp4
48 |
49 |
50 | ## mine
51 |
52 |
53 | https://user-images.githubusercontent.com/33898039/136545370-f15d7f4f-84f7-4521-8641-6116b1b6e2c5.mp4
54 |
55 |
56 | ## Login
57 |
58 |
59 | https://user-images.githubusercontent.com/33898039/136545393-0891c2b4-6671-4470-beb6-8b6dd9efa1ea.mp4
60 |
61 |
62 | ## add habit
63 |
64 |
65 | https://user-images.githubusercontent.com/33898039/136545432-5a66dd06-9f11-4286-92d6-054bef07d063.mp4
66 |
67 |
68 | ## habit detail
69 |
70 | https://user-images.githubusercontent.com/33898039/136545480-7a0f68a5-b94f-42e7-a12d-7c925bf19844.mp4
71 |
72 | ## add record
73 |
74 |
75 | https://user-images.githubusercontent.com/33898039/136545509-0affb455-046d-49b5-a696-ffa5a75d150b.mp4
76 |
77 | ## change mode
78 |
79 |
80 | https://user-images.githubusercontent.com/33898039/136545621-f8872cc1-cdc5-4af1-94a4-46bb65c6b51c.mp4
81 |
82 | ## change color
83 |
84 | https://user-images.githubusercontent.com/33898039/136545668-c8cc063e-8bbd-4219-8481-44aeae40b26b.mp4
85 |
86 |
87 |
88 |
89 |
90 |
--------------------------------------------------------------------------------
/android/.gitignore:
--------------------------------------------------------------------------------
1 | gradle-wrapper.jar
2 | /.gradle
3 | /captures/
4 | /gradlew
5 | /gradlew.bat
6 | /local.properties
7 | GeneratedPluginRegistrant.java
8 |
9 | # Remember to never publicly share your keystore.
10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
11 | key.properties
12 |
--------------------------------------------------------------------------------
/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | def localProperties = new Properties()
2 | def localPropertiesFile = rootProject.file('local.properties')
3 | if (localPropertiesFile.exists()) {
4 | localPropertiesFile.withReader('UTF-8') { reader ->
5 | localProperties.load(reader)
6 | }
7 | }
8 |
9 | def flutterRoot = localProperties.getProperty('flutter.sdk')
10 | if (flutterRoot == null) {
11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12 | }
13 |
14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15 | if (flutterVersionCode == null) {
16 | flutterVersionCode = '1'
17 | }
18 |
19 | def flutterVersionName = localProperties.getProperty('flutter.versionName')
20 | if (flutterVersionName == null) {
21 | flutterVersionName = '1.0'
22 | }
23 |
24 | apply plugin: 'com.android.application'
25 | apply plugin: 'kotlin-android'
26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27 |
28 | android {
29 | compileSdkVersion 28
30 |
31 | sourceSets {
32 | main.java.srcDirs += 'src/main/kotlin'
33 | }
34 |
35 | lintOptions {
36 | checkReleaseBuilds false
37 | disable 'InvalidPackage'
38 | }
39 |
40 | defaultConfig {
41 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
42 | applicationId "com.sia.timefly"
43 | minSdkVersion 16
44 | targetSdkVersion 28
45 | versionCode flutterVersionCode.toInteger()
46 | versionName flutterVersionName
47 |
48 | /* ndk {
49 | abiFilters "armeabi-v7a", "arm64-v8a"
50 | }*/
51 | }
52 |
53 | buildTypes {
54 | release {
55 | // TODO: Add your own signing config for the release build.
56 | // Signing with the debug keys for now, so `flutter run --release` works.
57 | signingConfig signingConfigs.debug
58 | }
59 | }
60 | }
61 |
62 |
63 |
64 | flutter {
65 | source '../..'
66 | }
67 |
68 | dependencies {
69 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
70 | }
71 |
--------------------------------------------------------------------------------
/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
8 |
9 |
10 |
11 |
12 |
13 |
17 |
24 |
28 |
32 |
37 |
41 |
42 |
43 |
44 |
45 |
46 |
48 |
51 |
52 |
53 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/android/app/src/main/kotlin/com/sia/timefly/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.sia.timefly
2 |
3 | import io.flutter.embedding.android.FlutterActivity
4 |
5 | class MainActivity: FlutterActivity() {
6 | }
7 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable/notification.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/designDo/flutter-checkio/1441787d5474214b8dcc260b25b5cc3a40093f59/android/app/src/main/res/drawable/notification.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/designDo/flutter-checkio/1441787d5474214b8dcc260b25b5cc3a40093f59/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/designDo/flutter-checkio/1441787d5474214b8dcc260b25b5cc3a40093f59/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/designDo/flutter-checkio/1441787d5474214b8dcc260b25b5cc3a40093f59/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/designDo/flutter-checkio/1441787d5474214b8dcc260b25b5cc3a40093f59/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/store_1024pt.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/designDo/flutter-checkio/1441787d5474214b8dcc260b25b5cc3a40093f59/android/app/src/main/res/mipmap-xxhdpi/store_1024pt.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/temp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/designDo/flutter-checkio/1441787d5474214b8dcc260b25b5cc3a40093f59/android/app/src/main/res/mipmap-xxhdpi/temp.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/designDo/flutter-checkio/1441787d5474214b8dcc260b25b5cc3a40093f59/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext.kotlin_version = '1.3.50'
3 | repositories {
4 | maven{
5 | url 'https://maven.aliyun.com/repository/central'
6 | }
7 | maven{
8 | url 'https://maven.aliyun.com/repository/public'
9 | }
10 | maven{
11 | url 'https://maven.aliyun.com/repository/google'
12 | }
13 | maven{
14 | url 'https://maven.aliyun.com/repository/gradle-plugin'
15 | }
16 | //google()
17 | //jcenter()
18 | }
19 |
20 | dependencies {
21 | classpath 'com.android.tools.build:gradle:4.0.1'
22 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
23 | }
24 | }
25 |
26 | allprojects {
27 | repositories {
28 | maven{
29 | url 'https://maven.aliyun.com/repository/central'
30 | }
31 | maven{
32 | url 'https://maven.aliyun.com/repository/public'
33 | }
34 | maven{
35 | url 'https://maven.aliyun.com/repository/google'
36 | }
37 | maven{
38 | url 'https://maven.aliyun.com/repository/gradle-plugin'
39 | }
40 | // google()
41 | //jcenter()
42 | }
43 | }
44 |
45 | rootProject.buildDir = '../build'
46 | subprojects {
47 | project.buildDir = "${rootProject.buildDir}/${project.name}"
48 | }
49 | subprojects {
50 | project.evaluationDependsOn(':app')
51 | }
52 |
53 | task clean(type: Delete) {
54 | delete rootProject.buildDir
55 | }
56 |
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 | android.enableR8=true
3 | android.useAndroidX=true
4 | android.enableJetifier=true
5 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Jun 23 08:50:38 CEST 2017
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | #distributionUrl=file:///D:/gradle/gradle-6.1.1-all.zip
7 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
--------------------------------------------------------------------------------
/android/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
4 | def properties = new Properties()
5 |
6 | assert localPropertiesFile.exists()
7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
8 |
9 | def flutterSdkPath = properties.getProperty("flutter.sdk")
10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
12 |
--------------------------------------------------------------------------------
/android/settings_aar.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/assets/images/aquarium-水族馆.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/designDo/flutter-checkio/1441787d5474214b8dcc260b25b5cc3a40093f59/assets/images/aquarium-水族馆.png
--------------------------------------------------------------------------------
/assets/images/badminton-player-羽毛球.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/designDo/flutter-checkio/1441787d5474214b8dcc260b25b5cc3a40093f59/assets/images/badminton-player-羽毛球.png
--------------------------------------------------------------------------------
/assets/images/basketball-篮球.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/designDo/flutter-checkio/1441787d5474214b8dcc260b25b5cc3a40093f59/assets/images/basketball-篮球.png
--------------------------------------------------------------------------------
/assets/images/bianji.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/assets/images/bumblebee-熊峰.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/designDo/flutter-checkio/1441787d5474214b8dcc260b25b5cc3a40093f59/assets/images/bumblebee-熊峰.png
--------------------------------------------------------------------------------
/assets/images/butterfly-蝴蝶.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/designDo/flutter-checkio/1441787d5474214b8dcc260b25b5cc3a40093f59/assets/images/butterfly-蝴蝶.png
--------------------------------------------------------------------------------
/assets/images/calendar_view_day.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/assets/images/calendar_view_month.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/assets/images/calendar_view_week.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/assets/images/cat-footprint-猫抓.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/designDo/flutter-checkio/1441787d5474214b8dcc260b25b5cc3a40093f59/assets/images/cat-footprint-猫抓.png
--------------------------------------------------------------------------------
/assets/images/cute-hamster-可爱仓鼠.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/designDo/flutter-checkio/1441787d5474214b8dcc260b25b5cc3a40093f59/assets/images/cute-hamster-可爱仓鼠.png
--------------------------------------------------------------------------------
/assets/images/cycling-自行车.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/designDo/flutter-checkio/1441787d5474214b8dcc260b25b5cc3a40093f59/assets/images/cycling-自行车.png
--------------------------------------------------------------------------------
/assets/images/dinosaur-egg-龙宝宝.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/designDo/flutter-checkio/1441787d5474214b8dcc260b25b5cc3a40093f59/assets/images/dinosaur-egg-龙宝宝.png
--------------------------------------------------------------------------------
/assets/images/dog-狗.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/designDo/flutter-checkio/1441787d5474214b8dcc260b25b5cc3a40093f59/assets/images/dog-狗.png
--------------------------------------------------------------------------------
/assets/images/dove-鸽子.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/designDo/flutter-checkio/1441787d5474214b8dcc260b25b5cc3a40093f59/assets/images/dove-鸽子.png
--------------------------------------------------------------------------------
/assets/images/duigou.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/assets/images/exercise-运动.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/designDo/flutter-checkio/1441787d5474214b8dcc260b25b5cc3a40093f59/assets/images/exercise-运动.png
--------------------------------------------------------------------------------
/assets/images/fanhui.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/assets/images/fishing-钓鱼.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/designDo/flutter-checkio/1441787d5474214b8dcc260b25b5cc3a40093f59/assets/images/fishing-钓鱼.png
--------------------------------------------------------------------------------
/assets/images/flamingo-火烈鸟.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/designDo/flutter-checkio/1441787d5474214b8dcc260b25b5cc3a40093f59/assets/images/flamingo-火烈鸟.png
--------------------------------------------------------------------------------
/assets/images/guanbi.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/assets/images/habit_check.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/assets/images/icon_contect.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/assets/images/icon_fivestar.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/assets/images/icon_jiaohuan.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/assets/images/icon_theme.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/assets/images/icon_today.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/assets/images/jia.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/assets/images/jian.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/assets/images/jiaohuan.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/assets/images/jump-rope-跳绳.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/designDo/flutter-checkio/1441787d5474214b8dcc260b25b5cc3a40093f59/assets/images/jump-rope-跳绳.png
--------------------------------------------------------------------------------
/assets/images/navigation_left.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/assets/images/navigation_right.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/assets/images/parrot-鹦鹉.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/designDo/flutter-checkio/1441787d5474214b8dcc260b25b5cc3a40093f59/assets/images/parrot-鹦鹉.png
--------------------------------------------------------------------------------
/assets/images/pilates-普拉提.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/designDo/flutter-checkio/1441787d5474214b8dcc260b25b5cc3a40093f59/assets/images/pilates-普拉提.png
--------------------------------------------------------------------------------
/assets/images/ping-pong-乒乓球.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/designDo/flutter-checkio/1441787d5474214b8dcc260b25b5cc3a40093f59/assets/images/ping-pong-乒乓球.png
--------------------------------------------------------------------------------
/assets/images/skateboard-滑板.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/designDo/flutter-checkio/1441787d5474214b8dcc260b25b5cc3a40093f59/assets/images/skateboard-滑板.png
--------------------------------------------------------------------------------
/assets/images/swan-天鹅.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/designDo/flutter-checkio/1441787d5474214b8dcc260b25b5cc3a40093f59/assets/images/swan-天鹅.png
--------------------------------------------------------------------------------
/assets/images/tennis-racquet-网球.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/designDo/flutter-checkio/1441787d5474214b8dcc260b25b5cc3a40093f59/assets/images/tennis-racquet-网球.png
--------------------------------------------------------------------------------
/assets/images/time.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/assets/images/treadmill-跑步机.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/designDo/flutter-checkio/1441787d5474214b8dcc260b25b5cc3a40093f59/assets/images/treadmill-跑步机.png
--------------------------------------------------------------------------------
/assets/images/user_icon.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/designDo/flutter-checkio/1441787d5474214b8dcc260b25b5cc3a40093f59/assets/images/user_icon.jpg
--------------------------------------------------------------------------------
/assets/images/wancheng.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/assets/images/zhouqi.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/fonts/MaShanZheng-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/designDo/flutter-checkio/1441787d5474214b8dcc260b25b5cc3a40093f59/fonts/MaShanZheng-Regular.ttf
--------------------------------------------------------------------------------
/fonts/Montserrat-Bold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/designDo/flutter-checkio/1441787d5474214b8dcc260b25b5cc3a40093f59/fonts/Montserrat-Bold.ttf
--------------------------------------------------------------------------------
/fonts/Montserrat-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/designDo/flutter-checkio/1441787d5474214b8dcc260b25b5cc3a40093f59/fonts/Montserrat-Regular.ttf
--------------------------------------------------------------------------------
/ios/.gitignore:
--------------------------------------------------------------------------------
1 | *.mode1v3
2 | *.mode2v3
3 | *.moved-aside
4 | *.pbxuser
5 | *.perspectivev3
6 | **/*sync/
7 | .sconsign.dblite
8 | .tags*
9 | **/.vagrant/
10 | **/DerivedData/
11 | Icon?
12 | **/Pods/
13 | **/.symlinks/
14 | profile
15 | xcuserdata
16 | **/.generated/
17 | Flutter/App.framework
18 | Flutter/Flutter.framework
19 | Flutter/Flutter.podspec
20 | Flutter/Generated.xcconfig
21 | Flutter/app.flx
22 | Flutter/app.zip
23 | Flutter/flutter_assets/
24 | Flutter/flutter_export_environment.sh
25 | ServiceDefinitions.json
26 | Runner/GeneratedPluginRegistrant.*
27 |
28 | # Exceptions to above rules.
29 | !default.mode1v3
30 | !default.mode2v3
31 | !default.pbxuser
32 | !default.perspectivev3
33 |
--------------------------------------------------------------------------------
/ios/Flutter/AppFrameworkInfo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | App
9 | CFBundleIdentifier
10 | io.flutter.flutter.app
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | App
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | MinimumOSVersion
24 | 8.0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/ios/Podfile:
--------------------------------------------------------------------------------
1 | # Uncomment this line to define a global platform for your project
2 | # platform :ios, '9.0'
3 |
4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true'
6 |
7 | project 'Runner', {
8 | 'Debug' => :debug,
9 | 'Profile' => :release,
10 | 'Release' => :release,
11 | }
12 |
13 | def flutter_root
14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
15 | unless File.exist?(generated_xcode_build_settings_path)
16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
17 | end
18 |
19 | File.foreach(generated_xcode_build_settings_path) do |line|
20 | matches = line.match(/FLUTTER_ROOT\=(.*)/)
21 | return matches[1].strip if matches
22 | end
23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
24 | end
25 |
26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
27 |
28 | flutter_ios_podfile_setup
29 |
30 | target 'Runner' do
31 | use_frameworks!
32 | use_modular_headers!
33 |
34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
35 | end
36 |
37 | post_install do |installer|
38 | installer.pods_project.targets.each do |target|
39 | flutter_additional_ios_build_settings(target)
40 | end
41 | end
42 |
--------------------------------------------------------------------------------
/ios/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - Flutter (1.0.0)
3 | - flutter_local_notifications (0.0.1):
4 | - Flutter
5 | - fluttertoast (0.0.2):
6 | - Flutter
7 | - Toast
8 | - FMDB (2.7.5):
9 | - FMDB/standard (= 2.7.5)
10 | - FMDB/standard (2.7.5)
11 | - shared_preferences (0.0.1):
12 | - Flutter
13 | - sqflite (0.0.1):
14 | - Flutter
15 | - FMDB (~> 2.7.2)
16 | - Toast (4.0.0)
17 |
18 | DEPENDENCIES:
19 | - Flutter (from `Flutter`)
20 | - flutter_local_notifications (from `.symlinks/plugins/flutter_local_notifications/ios`)
21 | - fluttertoast (from `.symlinks/plugins/fluttertoast/ios`)
22 | - shared_preferences (from `.symlinks/plugins/shared_preferences/ios`)
23 | - sqflite (from `.symlinks/plugins/sqflite/ios`)
24 |
25 | SPEC REPOS:
26 | trunk:
27 | - FMDB
28 | - Toast
29 |
30 | EXTERNAL SOURCES:
31 | Flutter:
32 | :path: Flutter
33 | flutter_local_notifications:
34 | :path: ".symlinks/plugins/flutter_local_notifications/ios"
35 | fluttertoast:
36 | :path: ".symlinks/plugins/fluttertoast/ios"
37 | shared_preferences:
38 | :path: ".symlinks/plugins/shared_preferences/ios"
39 | sqflite:
40 | :path: ".symlinks/plugins/sqflite/ios"
41 |
42 | SPEC CHECKSUMS:
43 | Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
44 | flutter_local_notifications: 0c0b1ae97e741e1521e4c1629a459d04b9aec743
45 | fluttertoast: 6122fa75143e992b1d3470f61000f591a798cc58
46 | FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
47 | shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d
48 | sqflite: 4001a31ff81d210346b500c55b17f4d6c7589dd0
49 | Toast: 91b396c56ee72a5790816f40d3a94dd357abc196
50 |
51 | PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c
52 |
53 | COCOAPODS: 1.10.0
54 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
39 |
40 |
41 |
42 |
43 |
44 |
54 |
56 |
62 |
63 |
64 |
65 |
66 |
67 |
73 |
75 |
81 |
82 |
83 |
84 |
86 |
87 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 | import Flutter
3 |
4 | @UIApplicationMain
5 | @objc class AppDelegate: FlutterAppDelegate {
6 | override func application(
7 | _ application: UIApplication,
8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
9 | ) -> Bool {
10 | GeneratedPluginRegistrant.register(with: self)
11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions)
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "20x20",
5 | "idiom" : "iphone",
6 | "filename" : "Icon-App-20x20@2x.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "20x20",
11 | "idiom" : "iphone",
12 | "filename" : "Icon-App-20x20@3x.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "Icon-App-29x29@1x.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "29x29",
23 | "idiom" : "iphone",
24 | "filename" : "Icon-App-29x29@2x.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "29x29",
29 | "idiom" : "iphone",
30 | "filename" : "Icon-App-29x29@3x.png",
31 | "scale" : "3x"
32 | },
33 | {
34 | "size" : "40x40",
35 | "idiom" : "iphone",
36 | "filename" : "Icon-App-40x40@2x.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "40x40",
41 | "idiom" : "iphone",
42 | "filename" : "Icon-App-40x40@3x.png",
43 | "scale" : "3x"
44 | },
45 | {
46 | "size" : "60x60",
47 | "idiom" : "iphone",
48 | "filename" : "Icon-App-60x60@2x.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "60x60",
53 | "idiom" : "iphone",
54 | "filename" : "Icon-App-60x60@3x.png",
55 | "scale" : "3x"
56 | },
57 | {
58 | "size" : "20x20",
59 | "idiom" : "ipad",
60 | "filename" : "Icon-App-20x20@1x.png",
61 | "scale" : "1x"
62 | },
63 | {
64 | "size" : "20x20",
65 | "idiom" : "ipad",
66 | "filename" : "Icon-App-20x20@2x.png",
67 | "scale" : "2x"
68 | },
69 | {
70 | "size" : "29x29",
71 | "idiom" : "ipad",
72 | "filename" : "Icon-App-29x29@1x.png",
73 | "scale" : "1x"
74 | },
75 | {
76 | "size" : "29x29",
77 | "idiom" : "ipad",
78 | "filename" : "Icon-App-29x29@2x.png",
79 | "scale" : "2x"
80 | },
81 | {
82 | "size" : "40x40",
83 | "idiom" : "ipad",
84 | "filename" : "Icon-App-40x40@1x.png",
85 | "scale" : "1x"
86 | },
87 | {
88 | "size" : "40x40",
89 | "idiom" : "ipad",
90 | "filename" : "Icon-App-40x40@2x.png",
91 | "scale" : "2x"
92 | },
93 | {
94 | "size" : "76x76",
95 | "idiom" : "ipad",
96 | "filename" : "Icon-App-76x76@1x.png",
97 | "scale" : "1x"
98 | },
99 | {
100 | "size" : "76x76",
101 | "idiom" : "ipad",
102 | "filename" : "Icon-App-76x76@2x.png",
103 | "scale" : "2x"
104 | },
105 | {
106 | "size" : "83.5x83.5",
107 | "idiom" : "ipad",
108 | "filename" : "Icon-App-83.5x83.5@2x.png",
109 | "scale" : "2x"
110 | },
111 | {
112 | "size" : "1024x1024",
113 | "idiom" : "ios-marketing",
114 | "filename" : "Icon-App-1024x1024@1x.png",
115 | "scale" : "1x"
116 | }
117 | ],
118 | "info" : {
119 | "version" : 1,
120 | "author" : "xcode"
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/designDo/flutter-checkio/1441787d5474214b8dcc260b25b5cc3a40093f59/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/designDo/flutter-checkio/1441787d5474214b8dcc260b25b5cc3a40093f59/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/designDo/flutter-checkio/1441787d5474214b8dcc260b25b5cc3a40093f59/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/designDo/flutter-checkio/1441787d5474214b8dcc260b25b5cc3a40093f59/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/designDo/flutter-checkio/1441787d5474214b8dcc260b25b5cc3a40093f59/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/designDo/flutter-checkio/1441787d5474214b8dcc260b25b5cc3a40093f59/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/designDo/flutter-checkio/1441787d5474214b8dcc260b25b5cc3a40093f59/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/designDo/flutter-checkio/1441787d5474214b8dcc260b25b5cc3a40093f59/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/designDo/flutter-checkio/1441787d5474214b8dcc260b25b5cc3a40093f59/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/designDo/flutter-checkio/1441787d5474214b8dcc260b25b5cc3a40093f59/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/designDo/flutter-checkio/1441787d5474214b8dcc260b25b5cc3a40093f59/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/designDo/flutter-checkio/1441787d5474214b8dcc260b25b5cc3a40093f59/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/designDo/flutter-checkio/1441787d5474214b8dcc260b25b5cc3a40093f59/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/designDo/flutter-checkio/1441787d5474214b8dcc260b25b5cc3a40093f59/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/designDo/flutter-checkio/1441787d5474214b8dcc260b25b5cc3a40093f59/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "LaunchImage.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "LaunchImage@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "LaunchImage@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/designDo/flutter-checkio/1441787d5474214b8dcc260b25b5cc3a40093f59/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/designDo/flutter-checkio/1441787d5474214b8dcc260b25b5cc3a40093f59/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/designDo/flutter-checkio/1441787d5474214b8dcc260b25b5cc3a40093f59/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md:
--------------------------------------------------------------------------------
1 | # Launch Screen Assets
2 |
3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory.
4 |
5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
--------------------------------------------------------------------------------
/ios/Runner/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/ios/Runner/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/ios/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | timefly
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | $(FLUTTER_BUILD_NAME)
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | $(FLUTTER_BUILD_NUMBER)
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIMainStoryboardFile
28 | Main
29 | UISupportedInterfaceOrientations
30 |
31 | UIInterfaceOrientationPortrait
32 | UIInterfaceOrientationLandscapeLeft
33 | UIInterfaceOrientationLandscapeRight
34 |
35 | UISupportedInterfaceOrientations~ipad
36 |
37 | UIInterfaceOrientationPortrait
38 | UIInterfaceOrientationPortraitUpsideDown
39 | UIInterfaceOrientationLandscapeLeft
40 | UIInterfaceOrientationLandscapeRight
41 |
42 | UIViewControllerBasedStatusBarAppearance
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
2 |
--------------------------------------------------------------------------------
/lib/add_habit/edit_name.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:timefly/app_theme.dart';
3 | import 'package:timefly/utils/pair.dart';
4 | import 'package:timefly/widget/custom_edit_field.dart';
5 |
6 | class EditFiledView extends StatefulWidget {
7 | final Mutable content;
8 |
9 | const EditFiledView({
10 | Key key,
11 | this.content,
12 | }) : super(key: key);
13 |
14 | @override
15 | _EditFiledViewState createState() => _EditFiledViewState();
16 | }
17 |
18 | class _EditFiledViewState extends State {
19 | @override
20 | Widget build(BuildContext context) {
21 | return Scaffold(
22 | backgroundColor: Colors.black54,
23 | body: Center(
24 | child: Container(
25 | padding: EdgeInsets.only(top: 32, bottom: 32),
26 | margin: EdgeInsets.only(left: 32, right: 32),
27 | decoration: BoxDecoration(
28 | shape: BoxShape.rectangle,
29 | borderRadius: BorderRadius.all(Radius.circular(15)),
30 | color: AppTheme.appTheme.cardBackgroundColor()),
31 | child: CustomEditField(
32 | maxLength: 50,
33 | autoFucus: true,
34 | initValue: widget.content.value,
35 | hintText: '记录些什么 ...',
36 | hintTextStyle: AppTheme.appTheme
37 | .hint(fontWeight: FontWeight.normal, fontSize: 16),
38 | textStyle: AppTheme.appTheme
39 | .headline1(fontWeight: FontWeight.normal, fontSize: 16),
40 | minHeight: 100,
41 | containerDecoration: BoxDecoration(
42 | shape: BoxShape.rectangle,
43 | borderRadius: BorderRadius.all(Radius.circular(15)),
44 | color: AppTheme.appTheme.containerBackgroundColor()),
45 | numDecoration: BoxDecoration(
46 | shape: BoxShape.rectangle,
47 | color: AppTheme.appTheme.cardBackgroundColor(),
48 | borderRadius: BorderRadius.all(Radius.circular(15)),
49 | boxShadow: AppTheme.appTheme.containerBoxShadow()),
50 | numTextStyle: AppTheme.appTheme
51 | .themeText(fontWeight: FontWeight.bold, fontSize: 15),
52 | onValueChanged: (value) {
53 | widget.content.value = value;
54 | },
55 | ),
56 | ),
57 | ),
58 | floatingActionButton: FloatingActionButton(
59 | onPressed: () {
60 | Navigator.of(context).pop();
61 | },
62 | child: Icon(Icons.done),
63 | backgroundColor: AppTheme.appTheme.grandientColorStart(),
64 | ),
65 | );
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/lib/add_habit/icon_color.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_svg/flutter_svg.dart';
3 | import 'package:timefly/models/habit_color.dart';
4 | import 'package:timefly/models/habit_icon.dart';
5 |
6 | import '../app_theme.dart';
7 |
8 | class IconAndColorPage extends StatefulWidget {
9 | final String selectedIcon;
10 | final Color selectedColor;
11 |
12 | const IconAndColorPage({Key key, this.selectedIcon, this.selectedColor})
13 | : super(key: key);
14 |
15 | @override
16 | _IconAndColorPageState createState() => _IconAndColorPageState();
17 | }
18 |
19 | class _IconAndColorPageState extends State {
20 | List icons = [];
21 | HabitIcon _selectIcon;
22 |
23 | List backgroundColors = [];
24 | HabitColor _selectBackgroundColor;
25 |
26 | @override
27 | void initState() {
28 | icons = HabitIcon.getIcons();
29 |
30 | icons.forEach((icon) {
31 | if (icon.icon == widget.selectedIcon) {
32 | icon.isSelect = true;
33 | _selectIcon = icon;
34 | } else {
35 | icon.isSelect = false;
36 | }
37 | });
38 |
39 | backgroundColors = HabitColor.getBackgroundColors();
40 | backgroundColors.forEach((color) {
41 | if (color.color.value == widget.selectedColor.value) {
42 | color.isSelect = true;
43 | _selectBackgroundColor = color;
44 | } else {
45 | color.isSelect = false;
46 | }
47 | });
48 |
49 | super.initState();
50 | }
51 |
52 | @override
53 | Widget build(BuildContext context) {
54 | return Center(
55 | child: Container(
56 | height: 450,
57 | width: MediaQuery.of(context).size.width * 0.85,
58 | decoration: BoxDecoration(
59 | shape: BoxShape.rectangle,
60 | borderRadius: BorderRadius.all(Radius.circular(20)),
61 | color: AppTheme.appTheme.cardBackgroundColor(),
62 | ),
63 | child: Column(
64 | children: [
65 | SizedBox(
66 | height: 20,
67 | ),
68 | Container(
69 | padding: EdgeInsets.only(top: 16, bottom: 16),
70 | height: 240,
71 | child: GridView.builder(
72 | padding: EdgeInsets.only(left: 18),
73 | itemCount: icons.length,
74 | gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
75 | crossAxisCount: 3,
76 | mainAxisSpacing: 10,
77 | crossAxisSpacing: 10),
78 | itemBuilder: (context, index) {
79 | return GestureDetector(
80 | onTap: () {
81 | setState(() {
82 | icons.forEach((element) {
83 | element.isSelect = false;
84 | });
85 | icons[index].isSelect = true;
86 | _selectIcon = icons[index];
87 | });
88 | },
89 | child: AnimatedContainer(
90 | duration: Duration(milliseconds: 300),
91 | decoration: BoxDecoration(
92 | borderRadius: BorderRadius.all(Radius.circular(10)),
93 | shape: BoxShape.rectangle,
94 | color: (icons[index].isSelect
95 | ? _selectBackgroundColor.color
96 | : AppTheme.appTheme.containerBackgroundColor())),
97 | alignment: Alignment.center,
98 | child: Image.asset(
99 | icons[index].icon,
100 | width: 40,
101 | height: 40,
102 | ),
103 | ),
104 | );
105 | },
106 | scrollDirection: Axis.horizontal,
107 | ),
108 | ),
109 | Container(
110 | height: 130,
111 | padding: EdgeInsets.only(top: 16, bottom: 16),
112 | child: GridView.builder(
113 | scrollDirection: Axis.horizontal,
114 | padding: EdgeInsets.only(left: 18),
115 | itemCount: backgroundColors.length,
116 | gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
117 | crossAxisCount: 2,
118 | mainAxisSpacing: 16,
119 | crossAxisSpacing: 16),
120 | itemBuilder: (context, index) {
121 | HabitColor habitColor = backgroundColors[index];
122 | return GestureDetector(
123 | onTap: () {
124 | setState(() {
125 | backgroundColors.forEach((element) {
126 | element.isSelect = false;
127 | });
128 | backgroundColors[index].isSelect = true;
129 | _selectBackgroundColor = backgroundColors[index];
130 | });
131 | },
132 | child: AnimatedContainer(
133 | alignment: Alignment.center,
134 | width: 50,
135 | height: 50,
136 | decoration: BoxDecoration(
137 | shape: BoxShape.circle,
138 | border: Border.all(
139 | color: habitColor.isSelect
140 | ? habitColor.color
141 | : AppTheme.appTheme
142 | .containerBackgroundColor(),
143 | width: habitColor.isSelect ? 3 : 1.5),
144 | color: Colors.transparent),
145 | child: habitColor.isSelect
146 | ? SizedBox()
147 | : Container(
148 | decoration: BoxDecoration(
149 | shape: BoxShape.circle,
150 | color: habitColor.color),
151 | width: 28,
152 | height: 28),
153 | duration: Duration(milliseconds: 300),
154 | ),
155 | );
156 | }),
157 | ),
158 | SizedBox(
159 | height: 5,
160 | ),
161 | Container(
162 | height: 40,
163 | child: GestureDetector(
164 | onTap: () {
165 | Map result = Map();
166 | print(_selectIcon.icon);
167 | result['icon'] = _selectIcon.icon;
168 | result['color'] = _selectBackgroundColor.color;
169 | Navigator.of(context).pop(result);
170 | },
171 | child: SvgPicture.asset(
172 | 'assets/images/duigou.svg',
173 | width: 35,
174 | height: 35,
175 | color: AppTheme.appTheme.normalColor(),
176 | ),
177 | ),
178 | )
179 | ],
180 | ),
181 | ),
182 | );
183 | }
184 | }
185 |
--------------------------------------------------------------------------------
/lib/add_habit/modify_change_dialog.dart:
--------------------------------------------------------------------------------
1 | import 'package:alarm_plugin/alarm_event.dart';
2 | import 'package:alarm_plugin/alarm_plugin.dart';
3 | import 'package:flutter/cupertino.dart';
4 | import 'package:flutter/material.dart';
5 | import 'package:flutter_bloc/flutter_bloc.dart';
6 | import 'package:timefly/app_theme.dart';
7 | import 'package:timefly/blocs/habit/habit_bloc.dart';
8 | import 'package:timefly/blocs/habit/habit_event.dart';
9 | import 'package:timefly/models/habit.dart';
10 | import 'package:timefly/utils/flash_helper.dart';
11 |
12 | class ModifyChangeDialog extends StatefulWidget {
13 | final String title;
14 | final String subTitle;
15 |
16 | const ModifyChangeDialog({
17 | Key key,
18 | this.title,
19 | this.subTitle,
20 | }) : super(key: key);
21 |
22 | @override
23 | _ModifyChangeDialogState createState() => _ModifyChangeDialogState();
24 | }
25 |
26 | class _ModifyChangeDialogState extends State
27 | with SingleTickerProviderStateMixin {
28 | AnimationController animationController;
29 |
30 | @override
31 | void initState() {
32 | super.initState();
33 | animationController =
34 | AnimationController(duration: Duration(milliseconds: 300), vsync: this);
35 | animationController.forward();
36 | }
37 |
38 | @override
39 | Widget build(BuildContext context) {
40 | return Center(
41 | child: ScaleTransition(
42 | scale: Tween(begin: 0.2, end: 1).animate(CurvedAnimation(
43 | parent: animationController, curve: Curves.easeOutBack)),
44 | child: Container(
45 | alignment: Alignment.center,
46 | padding: EdgeInsets.all(16),
47 | decoration: BoxDecoration(
48 | shape: BoxShape.rectangle,
49 | borderRadius: BorderRadius.all(Radius.circular(16)),
50 | boxShadow: AppTheme.appTheme.containerBoxShadow(),
51 | color: AppTheme.appTheme.cardBackgroundColor()),
52 | height: 200,
53 | margin: EdgeInsets.only(left: 32, right: 32),
54 | child: Column(
55 | children: [
56 | SizedBox(
57 | height: 8,
58 | ),
59 | Text(
60 | widget.title,
61 | style: AppTheme.appTheme
62 | .headline1(fontWeight: FontWeight.bold, fontSize: 20)
63 | .copyWith(decoration: TextDecoration.none),
64 | ),
65 | SizedBox(
66 | height: 8,
67 | ),
68 | Text(
69 | widget.subTitle,
70 | style: AppTheme.appTheme
71 | .headline1(fontWeight: FontWeight.normal, fontSize: 16)
72 | .copyWith(decoration: TextDecoration.none),
73 | ),
74 | SizedBox(
75 | height: 16,
76 | ),
77 | GestureDetector(
78 | onTap: () {
79 | Navigator.of(context).pop();
80 | },
81 | child: Container(
82 | alignment: Alignment.center,
83 | decoration: BoxDecoration(
84 | gradient: AppTheme.appTheme.containerGradient(),
85 | boxShadow: AppTheme.appTheme.coloredBoxShadow(),
86 | shape: BoxShape.rectangle,
87 | borderRadius: BorderRadius.all(Radius.circular(35))),
88 | width: 150,
89 | height: 50,
90 | child: Text(
91 | '知道啦',
92 | style: AppTheme.appTheme
93 | .headline1(
94 | textColor: Colors.white,
95 | fontWeight: FontWeight.normal,
96 | fontSize: 16)
97 | .copyWith(decoration: TextDecoration.none),
98 | ),
99 | ),
100 | )
101 | ],
102 | ),
103 | ),
104 | ),
105 | );
106 | }
107 |
108 | @override
109 | void dispose() {
110 | animationController.dispose();
111 | super.dispose();
112 | }
113 | }
114 |
--------------------------------------------------------------------------------
/lib/all_habits/all_habit_list_view.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:timefly/all_habits/all_habit_item_view.dart';
3 | import 'package:timefly/db/database_provider.dart';
4 | import 'package:timefly/models/habit.dart';
5 |
6 | class AllHabitListView extends StatefulWidget {
7 | final List habits;
8 |
9 | const AllHabitListView({Key key, this.habits}) : super(key: key);
10 |
11 | @override
12 | _AllHabitListViewState createState() => _AllHabitListViewState();
13 | }
14 |
15 | class _AllHabitListViewState extends State
16 | with AutomaticKeepAliveClientMixin {
17 | final ScrollController scrollController = ScrollController();
18 |
19 | Habit _selectedHabit;
20 |
21 | double _listPadding = 16;
22 |
23 | @override
24 | void initState() {
25 | super.initState();
26 | }
27 |
28 | @override
29 | Widget build(BuildContext context) {
30 | super.build(context);
31 | return ClipPath(
32 | clipper: TopClipper(),
33 | child: Container(
34 | margin: EdgeInsets.only(top: 6),
35 | child: ListView.builder(
36 | itemBuilder: (context, index) {
37 | return Container(
38 | margin: EdgeInsets.symmetric(
39 | vertical: _listPadding / 2,
40 | ),
41 | child: AllHabitItemView(
42 | habit: widget.habits[index],
43 | isOpen: widget.habits[index] == _selectedHabit,
44 | onTap: _handleHabitTapped,
45 | ),
46 | );
47 | },
48 | itemCount: widget.habits.length,
49 | controller: scrollController,
50 | padding: EdgeInsets.only(
51 | top: 3,
52 | bottom: MediaQuery.of(context).padding.bottom,
53 | )),
54 | ),
55 | );
56 | }
57 |
58 | void _handleHabitTapped(Habit data) {
59 | setState(() {
60 | //If the same habit was tapped twice, un-select it
61 | if (_selectedHabit == data) {
62 | _selectedHabit = null;
63 | }
64 | //Open tapped habit card and scroll to it
65 | else {
66 | _selectedHabit = data;
67 | var selectedIndex = widget.habits.indexOf(_selectedHabit);
68 | var closedHeight = AllHabitItemView.nominalHeightClosed;
69 | //Calculate scrollTo offset, subtract a bit so we don't end up perfectly at the top
70 | var offset =
71 | selectedIndex * (closedHeight + _listPadding) - closedHeight * .8;
72 | scrollController.animateTo(offset,
73 | duration: Duration(milliseconds: 700), curve: Curves.easeOutQuad);
74 | }
75 | });
76 | }
77 |
78 | @override
79 | bool get wantKeepAlive => true;
80 | }
81 |
82 | class TopClipper extends CustomClipper {
83 | @override
84 | Path getClip(Size size) {
85 | var path = Path();
86 | path.lineTo(0, 20);
87 | var point0 = Offset(size.width / 2, 0);
88 | var point1 = Offset(size.width, 20);
89 | path.quadraticBezierTo(point0.dx, point0.dy, point1.dx, point1.dy);
90 | path.lineTo(size.width, size.height);
91 | path.lineTo(0, size.height);
92 | return path;
93 | }
94 |
95 | @override
96 | bool shouldReclip(CustomClipper oldClipper) {
97 | return false;
98 | }
99 | }
100 |
--------------------------------------------------------------------------------
/lib/blocs/bloc_observer.dart:
--------------------------------------------------------------------------------
1 | import 'package:bloc/bloc.dart';
2 |
3 | class SimpleBlocObserver extends BlocObserver {
4 | @override
5 | void onEvent(Bloc bloc, Object event) {
6 | super.onEvent(bloc, event);
7 | print(event);
8 | }
9 |
10 | @override
11 | void onTransition(Bloc bloc, Transition transition) {
12 | super.onTransition(bloc, transition);
13 | print(transition);
14 | }
15 |
16 | @override
17 | void onError(BlocBase bloc, Object error, StackTrace stackTrace) {
18 | print(error);
19 | super.onError(bloc, error, stackTrace);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/lib/blocs/habit/habit_bloc.dart:
--------------------------------------------------------------------------------
1 | import 'package:bloc/bloc.dart';
2 | import 'package:timefly/blocs/habit/habit_event.dart';
3 | import 'package:timefly/blocs/habit/habit_state.dart';
4 | import 'package:timefly/db/database_provider.dart';
5 | import 'package:timefly/models/habit.dart';
6 | import 'package:timefly/models/user.dart';
7 |
8 | class HabitsBloc extends Bloc {
9 | ///初始化状态为正在加载
10 | HabitsBloc() : super(HabitsLoadInProgress()) {
11 | on(_mapHabitsLoadToState);
12 | on(_mapHabitsAddToState);
13 | on(_mapHabitUpdateToState);
14 | }
15 |
16 | void _mapHabitsLoadToState(
17 | HabitsLoad event, Emitter emit) async {
18 | try {
19 | if (!SessionUtils.sharedInstance().isLogin()) {
20 | emit(HabitLoadSuccess([]));
21 | return;
22 | }
23 | List habits = await DatabaseProvider.db.getAllHabits();
24 | print(habits);
25 | emit(HabitLoadSuccess(habits));
26 | } catch (e) {
27 | print(e);
28 | emit(HabitsLodeFailure());
29 | }
30 | }
31 |
32 | void _mapHabitsAddToState(HabitsAdd event, Emitter emit) {
33 | if (state is HabitLoadSuccess) {
34 | final List habits = List.from((state as HabitLoadSuccess).habits)
35 | ..add(event.habit);
36 | emit(HabitLoadSuccess(habits));
37 | DatabaseProvider.db.insert(event.habit);
38 | }
39 | }
40 |
41 | void _mapHabitUpdateToState(HabitUpdate event, Emitter emit) {
42 | if (state is HabitLoadSuccess) {
43 | final List habits = (state as HabitLoadSuccess)
44 | .habits
45 | .map((habit) => habit.id == event.habit.id ? event.habit : habit)
46 | .toList();
47 | emit(HabitLoadSuccess(habits));
48 | DatabaseProvider.db.update(event.habit);
49 | }
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/lib/blocs/habit/habit_event.dart:
--------------------------------------------------------------------------------
1 | import 'package:equatable/equatable.dart';
2 | import 'package:timefly/models/habit.dart';
3 |
4 | ///驱动UI的事件,数据库操作,将事件转化为包含数据的state返回
5 | class HabitsEvent extends Equatable {
6 | const HabitsEvent();
7 |
8 | @override
9 | List