├── .gitignore
├── .metadata
├── LICENSE
├── README.md
├── android
├── .gitignore
├── app
│ ├── build.gradle
│ └── src
│ │ ├── debug
│ │ └── AndroidManifest.xml
│ │ ├── main
│ │ ├── AndroidManifest.xml
│ │ ├── kotlin
│ │ │ └── com
│ │ │ │ └── example
│ │ │ │ └── fluttergithub
│ │ │ │ └── MainActivity.kt
│ │ └── res
│ │ │ ├── drawable
│ │ │ └── launch_background.xml
│ │ │ ├── mipmap-hdpi
│ │ │ ├── ic_launcher.png
│ │ │ ├── icon_launcher.png
│ │ │ └── icon_launcher_round.png
│ │ │ ├── mipmap-mdpi
│ │ │ ├── ic_launcher.png
│ │ │ ├── icon_launcher.png
│ │ │ └── icon_launcher_round.png
│ │ │ ├── mipmap-xhdpi
│ │ │ ├── ic_launcher.png
│ │ │ ├── icon_launcher.png
│ │ │ ├── icon_launcher_round.png
│ │ │ └── splash.jpg
│ │ │ ├── mipmap-xxhdpi
│ │ │ ├── ic_launcher.png
│ │ │ ├── icon_launcher.png
│ │ │ └── icon_launcher_round.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ ├── ic_launcher.png
│ │ │ ├── icon_launcher.png
│ │ │ └── icon_launcher_round.png
│ │ │ ├── values
│ │ │ └── styles.xml
│ │ │ └── xml
│ │ │ └── network_security_config.xml
│ │ └── profile
│ │ └── AndroidManifest.xml
├── build.gradle
├── gradle.properties
├── gradle
│ └── wrapper
│ │ └── gradle-wrapper.properties
└── settings.gradle
├── apk
└── flutterGithub.apk
├── demo
├── code-structure.png
├── demo1.jpg
├── demo10.jpg
├── demo11.jpg
├── demo12.jpg
├── demo2.jpg
├── demo3.jpg
├── demo4.jpg
├── demo5.jpg
├── demo6.jpg
├── demo7.jpg
├── demo8.jpg
├── demo9.jpg
├── gif-code.gif
├── gif-login.gif
├── gif-person.gif
├── gif-readme.gif
├── gif-repo.gif
├── gif-search.gif
├── gif-theme.gif
├── github-tip.jpeg
├── logo.png
└── qr_code.png
├── fonts
├── fileiconfont.ttf
└── iconfont.ttf
├── imgs
├── avatar_default.png
├── default_img.png
├── github_login_ic.png
├── login_back.jpg
├── repo_back0.gif
├── repo_back1.jpeg
├── repo_back2.jpeg
├── repo_back3.jpeg
├── repo_back4.jpg
└── repo_back5.jpeg
├── ios
├── .gitignore
├── Flutter
│ ├── AppFrameworkInfo.plist
│ ├── Debug.xcconfig
│ └── Release.xcconfig
├── Runner.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ └── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── Runner.xcscheme
├── Runner.xcworkspace
│ └── contents.xcworkspacedata
└── 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
├── jsons
├── RepoDaoBean.json
├── branchBean.json
├── cacheConfigBean.json
├── commitContentBean.json
├── commitDetailBean.json
├── commitDetailFileBean.json
├── commitDetailStatsBean.json
├── commitItemBean.json
├── commiterBean.json
├── eventBean.json
├── eventCommitBean.json
├── eventPayloadBean.json
├── fileBean.json
├── profileBean.json
├── readmeBean.json
├── repoBean.json
├── repoDetailBean.json
├── repoOwnerBean.json
├── trendDevSubBean.json
├── trendDeveloperBean.json
├── trendRepoBean.json
└── userBean.json
├── l10n-arb
├── intl_messages.arb
└── intl_zh_CN.arb
├── lib
├── common
│ ├── CacheObject.dart
│ ├── Global.dart
│ ├── constant
│ │ ├── constant.dart
│ │ └── ignore.dart
│ ├── delegate
│ │ ├── index.dart
│ │ └── sliver_delegate.dart
│ ├── event
│ │ └── event_bus.dart
│ ├── myAvatar.dart
│ ├── net
│ │ ├── NetApi.dart
│ │ └── api.dart
│ └── util
│ │ ├── CommonUtil.dart
│ │ ├── ListViewUtil.dart
│ │ ├── RelativeDateUtil.dart
│ │ ├── ReposEventUtil.dart
│ │ └── html_utils.dart
├── db
│ ├── dao
│ │ └── repo_history_dao.dart
│ ├── db_manager.dart
│ └── db_provider.dart
├── l10n
│ ├── localization_intl.dart
│ ├── messages_all.dart
│ ├── messages_messages.dart
│ └── messages_zh_CN.dart
├── main.dart
├── models
│ ├── RepoDaoBean.dart
│ ├── RepoDaoBean.g.dart
│ ├── branchBean.dart
│ ├── branchBean.g.dart
│ ├── cacheConfigBean.dart
│ ├── cacheConfigBean.g.dart
│ ├── commitContentBean.dart
│ ├── commitContentBean.g.dart
│ ├── commitDetailBean.dart
│ ├── commitDetailBean.g.dart
│ ├── commitDetailFileBean.dart
│ ├── commitDetailFileBean.g.dart
│ ├── commitDetailStatsBean.dart
│ ├── commitDetailStatsBean.g.dart
│ ├── commitItemBean.dart
│ ├── commitItemBean.g.dart
│ ├── commiterBean.dart
│ ├── commiterBean.g.dart
│ ├── eventBean.dart
│ ├── eventBean.g.dart
│ ├── eventCommitBean.dart
│ ├── eventCommitBean.g.dart
│ ├── eventPayloadBean.dart
│ ├── eventPayloadBean.g.dart
│ ├── fileBean.dart
│ ├── fileBean.g.dart
│ ├── index.dart
│ ├── profileBean.dart
│ ├── profileBean.g.dart
│ ├── readmeBean.dart
│ ├── readmeBean.g.dart
│ ├── repoBean.dart
│ ├── repoBean.g.dart
│ ├── repoDetailBean.dart
│ ├── repoDetailBean.g.dart
│ ├── repoOwnerBean.dart
│ ├── repoOwnerBean.g.dart
│ ├── trendDevSubBean.dart
│ ├── trendDevSubBean.g.dart
│ ├── trendDeveloperBean.dart
│ ├── trendDeveloperBean.g.dart
│ ├── trendRepoBean.dart
│ ├── trendRepoBean.g.dart
│ ├── userBean.dart
│ └── userBean.g.dart
├── res
│ ├── back_image.dart
│ ├── icons.dart
│ └── styles.dart
├── routes
│ ├── CommitDetail
│ │ ├── commit_detail_page.dart
│ │ └── repo_event_push_list.dart
│ ├── FileView
│ │ ├── code_detail_fullscreen.dart
│ │ ├── code_detail_web.dart
│ │ └── photo_view_page.dart
│ ├── SearchPage
│ │ ├── search_page_repos.dart
│ │ └── search_page_users.dart
│ ├── drawer
│ │ ├── follow_list_page.dart
│ │ ├── index.dart
│ │ ├── language_page.dart
│ │ ├── repos_history_page.dart
│ │ ├── test_page.dart
│ │ ├── theme_change_page.dart
│ │ └── trend
│ │ │ ├── trend_page.dart
│ │ │ ├── trend_page_developers.dart
│ │ │ └── trend_page_repos.dart
│ ├── home_page.dart
│ ├── login_page.dart
│ ├── person_detail_page.dart
│ ├── repo_detail_page.dart
│ ├── repo_list_page.dart
│ └── search_page.dart
├── states
│ ├── LocaleModel.dart
│ ├── ProfileChangeNotifier.dart
│ ├── ThemeModel.dart
│ ├── UserModel.dart
│ └── index.dart
└── widgets
│ ├── MyDrawer.dart
│ ├── PersonItem.dart
│ ├── RepoDetail
│ ├── index.dart
│ ├── repo_detail_commits.dart
│ ├── repo_detail_events.dart
│ ├── repo_detail_files.dart
│ ├── repo_detail_info.dart
│ └── repo_stargazer_or_watcher.dart
│ ├── RepoItem.dart
│ ├── TrendDevelopersItem.dart
│ ├── TrendReposItem.dart
│ ├── markdown
│ ├── my_markdown_widget.dart
│ └── syntax_high_lighter.dart
│ ├── myWidgets
│ ├── index.dart
│ ├── myCard.dart
│ ├── mySimpleWidget.dart
│ ├── mySpinKit.dart
│ └── no_data_or_no_net.dart
│ └── personDetail
│ ├── follow_person_list.dart
│ ├── person_event_list.dart
│ └── repo_list.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 | .dart_tool/
26 | .flutter-plugins
27 | .flutter-plugins-dependencies
28 | .packages
29 | .pub-cache/
30 | .pub/
31 | /build/
32 |
33 | # Web related
34 | lib/generated_plugin_registrant.dart
35 |
36 | # Exceptions to above rules.
37 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
38 | /token.txt
39 |
--------------------------------------------------------------------------------
/.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: f139b11009aeb8ed2a3a3aa8b0066e482709dde3
8 | channel: stable
9 |
10 | project_type: app
11 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 MrHGJ
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 | ## FlutterGithub
2 |
3 | 
4 |
5 |
6 | ### 用Flutter实现的一款界面精美、功能较全的Github客户端。支持多语言、换肤等功能。代码有充分注释、简单易懂,很适用于学习Flutter。
7 |
8 |
9 |
10 | ## 界面展示
11 |
12 |
18 |
24 |
30 |
31 | ## 下载体验
32 | 点击链接下载[https://github.com/MrHGJ/FlutterGithub/raw/master/apk/flutterGithub.apk]
33 |
34 | 或扫码下载apk进行体验:
35 |
36 | 
37 |
38 |
39 | ## 功能特性
40 | - **登陆页和首页:**
41 |
42 | 
43 |
44 | - **换肤功能:**
45 |
46 | 
47 |
48 | - **搜索功能:**
49 |
50 | 
51 |
52 | - **浏览源码:**
53 |
54 | 
55 |
56 | - **项目详情:**
57 |
58 | 
59 |
60 | - **个人详情:**
61 |
62 | 
63 |
64 | ## 开始使用
65 | 1. 配置好flutter环境;
66 | 2. clone本项目:
67 | ```
68 | $ git clone https://github.com/MrHGJ/FlutterGithub.git
69 | ```
70 | 3. **注意点:**需要注册一个Github的OAuth application,替换项目中的`clientId`和`clientSecret`(位置:**./lib/common/constant/ignore.dart**);
71 | 申请地址:[https://github.com/settings/applications/new](https://github.com/settings/applications/new)信息可以随便填写,没有什么具体要求。例如下图所示,填完后提交即可得到client_id和client_secret;
72 | 
73 | 4. 大功告成,直接运行即可;
74 | 5. 登录用github用户名和密码(暂不支持邮箱登陆)。
75 |
76 | ## 代码结构
77 | 
78 | - **fonts** 自定义的图标文件资源,.ttf格式;
79 |
80 | - **imgs** 图片资源;
81 |
82 | - **jsons** 存放生成Model类的json数据格式;
83 |
84 | - **l10n-arb** 多语言相关资源;
85 |
86 | - **lib**
87 |
88 | -- **common** 存放通用的类。例如全局变量、eventbus、网络请求、常用工具类等。
89 |
90 | -- **db** SQLite数据库相关类。
91 |
92 | -- **l10n** 多语言。
93 |
94 | -- **models** jsons文件夹对应的Dart Model实例类。
95 |
96 | -- **res** 资源文件。例如颜色、图片、自定义Icon图标、字体样式等。
97 |
98 | -- **routes** 存放所有页面路由类。
99 |
100 | -- **states** 保存APP中需要跨组件共享的状态类。
101 |
102 | -- **widges** 可复用的、常用的、封装的widget类。
103 |
104 | -- **main.dart** 程序入口。
105 |
106 | ## 相关文章
107 | - [**Flutter InfiniteListView学习与扩充**](https://blog.csdn.net/qq_34484722/article/details/106551197)
108 | - [**Github API (flutter调用)**](https://blog.csdn.net/qq_34484722/article/details/106540418)
109 | - [**Flutter App显示Github Readme文档**](https://blog.csdn.net/qq_34484722/article/details/106541277)
110 | - [**webview_flutter插件使用时报错**](https://blog.csdn.net/qq_34484722/article/details/106543039)
111 | - [**Flutter调试和打包**](https://blog.csdn.net/qq_34484722/article/details/106543282)
112 | - [**Flutter页面切换状态维持**](https://blog.csdn.net/qq_34484722/article/details/106543453)
113 | - [**Flutter图片蒙层背景的实现**](https://blog.csdn.net/qq_34484722/article/details/106550071)
114 |
115 | ## 第三方框架
116 |
117 | 库|功能
118 | :--:|:--:
119 | flutter_localizations和intl|国际化
120 | shared_preferences|SharedPreference本地缓存
121 | dio|网络请求
122 | cached_network_image| 加载网络图片并使用缓存
123 | provider|状态管理
124 | fluttertoast|toast显示
125 | flutter_markdown|显示markdown格式
126 | flukit|工具类,项目中主要使用了上拉加载更多列表InfiniteListView
127 | flutter_spinkit|炫酷的loading样式
128 | webview_flutter|提供webview支持
129 | event_bus|事件总线
130 | sqflite|sqlite 数据库
131 | photo_view|使图像能够通过用户手势(例如捏,旋转和拖动)进行缩放和平移
132 | ## 感谢
133 | ❤️ 学习flutter主要参考了[《Flutter实战》](https://book.flutterchina.club/)
134 | ❤️ 项目部分参考并借鉴 [GSYGithubAppFlutter](https://github.com/CarGuo/GSYGithubAppFlutter)
135 |
136 | ## License
137 | ```
138 | MrHGJ/FlutterGithub is licensed under the
139 | MIT License
140 |
141 | Copyright (c) 2020 MrHGJ
142 |
143 | Permission is hereby granted, free of charge, to any person obtaining a copy
144 | of this software and associated documentation files (the "Software"), to deal
145 | in the Software without restriction, including without limitation the rights
146 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
147 | copies of the Software, and to permit persons to whom the Software is
148 | furnished to do so, subject to the following conditions:
149 |
150 | The above copyright notice and this permission notice shall be included in all
151 | copies or substantial portions of the Software.
152 | ```
--------------------------------------------------------------------------------
/android/.gitignore:
--------------------------------------------------------------------------------
1 | gradle-wrapper.jar
2 | /.gradle
3 | /captures/
4 | /gradlew
5 | /gradlew.bat
6 | /local.properties
7 | GeneratedPluginRegistrant.java
8 |
--------------------------------------------------------------------------------
/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.example.fluttergithub"
43 | minSdkVersion 16
44 | targetSdkVersion 28
45 | versionCode flutterVersionCode.toInteger()
46 | versionName flutterVersionName
47 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
48 | }
49 |
50 | buildTypes {
51 | release {
52 | // TODO: Add your own signing config for the release build.
53 | // Signing with the debug keys for now, so `flutter run --release` works.
54 | signingConfig signingConfigs.debug
55 | }
56 | }
57 | }
58 |
59 | flutter {
60 | source '../..'
61 | }
62 |
63 | dependencies {
64 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
65 | testImplementation 'junit:junit:4.12'
66 | androidTestImplementation 'androidx.test:runner:1.1.1'
67 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
68 | }
69 |
--------------------------------------------------------------------------------
/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
9 |
15 |
22 |
23 |
24 |
25 |
26 |
27 |
29 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/android/app/src/main/kotlin/com/example/fluttergithub/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.example.fluttergithub
2 |
3 | import androidx.annotation.NonNull;
4 | import io.flutter.embedding.android.FlutterActivity
5 | import io.flutter.embedding.engine.FlutterEngine
6 | import io.flutter.plugins.GeneratedPluginRegistrant
7 |
8 | class MainActivity: FlutterActivity() {
9 | override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
10 | GeneratedPluginRegistrant.registerWith(flutterEngine);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | -
8 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-hdpi/icon_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/android/app/src/main/res/mipmap-hdpi/icon_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-hdpi/icon_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/android/app/src/main/res/mipmap-hdpi/icon_launcher_round.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-mdpi/icon_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/android/app/src/main/res/mipmap-mdpi/icon_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-mdpi/icon_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/android/app/src/main/res/mipmap-mdpi/icon_launcher_round.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/icon_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/android/app/src/main/res/mipmap-xhdpi/icon_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/icon_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/android/app/src/main/res/mipmap-xhdpi/icon_launcher_round.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/splash.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/android/app/src/main/res/mipmap-xhdpi/splash.jpg
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/icon_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/android/app/src/main/res/mipmap-xxhdpi/icon_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/icon_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/android/app/src/main/res/mipmap-xxhdpi/icon_launcher_round.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxxhdpi/icon_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/android/app/src/main/res/mipmap-xxxhdpi/icon_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxxhdpi/icon_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/android/app/src/main/res/mipmap-xxxhdpi/icon_launcher_round.png
--------------------------------------------------------------------------------
/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
--------------------------------------------------------------------------------
/android/app/src/main/res/xml/network_security_config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/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 | google()
5 | jcenter()
6 | }
7 |
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:3.5.0'
10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11 | }
12 | }
13 |
14 | allprojects {
15 | repositories {
16 | google()
17 | jcenter()
18 | }
19 | }
20 |
21 | rootProject.buildDir = '../build'
22 | subprojects {
23 | project.buildDir = "${rootProject.buildDir}/${project.name}"
24 | }
25 | subprojects {
26 | project.evaluationDependsOn(':app')
27 | }
28 |
29 | task clean(type: Delete) {
30 | delete rootProject.buildDir
31 | }
32 |
--------------------------------------------------------------------------------
/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=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
7 |
--------------------------------------------------------------------------------
/android/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
4 |
5 | def plugins = new Properties()
6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
7 | if (pluginsFile.exists()) {
8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
9 | }
10 |
11 | plugins.each { name, path ->
12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
13 | include ":$name"
14 | project(":$name").projectDir = pluginDirectory
15 | }
16 |
--------------------------------------------------------------------------------
/apk/flutterGithub.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/apk/flutterGithub.apk
--------------------------------------------------------------------------------
/demo/code-structure.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/demo/code-structure.png
--------------------------------------------------------------------------------
/demo/demo1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/demo/demo1.jpg
--------------------------------------------------------------------------------
/demo/demo10.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/demo/demo10.jpg
--------------------------------------------------------------------------------
/demo/demo11.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/demo/demo11.jpg
--------------------------------------------------------------------------------
/demo/demo12.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/demo/demo12.jpg
--------------------------------------------------------------------------------
/demo/demo2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/demo/demo2.jpg
--------------------------------------------------------------------------------
/demo/demo3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/demo/demo3.jpg
--------------------------------------------------------------------------------
/demo/demo4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/demo/demo4.jpg
--------------------------------------------------------------------------------
/demo/demo5.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/demo/demo5.jpg
--------------------------------------------------------------------------------
/demo/demo6.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/demo/demo6.jpg
--------------------------------------------------------------------------------
/demo/demo7.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/demo/demo7.jpg
--------------------------------------------------------------------------------
/demo/demo8.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/demo/demo8.jpg
--------------------------------------------------------------------------------
/demo/demo9.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/demo/demo9.jpg
--------------------------------------------------------------------------------
/demo/gif-code.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/demo/gif-code.gif
--------------------------------------------------------------------------------
/demo/gif-login.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/demo/gif-login.gif
--------------------------------------------------------------------------------
/demo/gif-person.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/demo/gif-person.gif
--------------------------------------------------------------------------------
/demo/gif-readme.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/demo/gif-readme.gif
--------------------------------------------------------------------------------
/demo/gif-repo.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/demo/gif-repo.gif
--------------------------------------------------------------------------------
/demo/gif-search.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/demo/gif-search.gif
--------------------------------------------------------------------------------
/demo/gif-theme.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/demo/gif-theme.gif
--------------------------------------------------------------------------------
/demo/github-tip.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/demo/github-tip.jpeg
--------------------------------------------------------------------------------
/demo/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/demo/logo.png
--------------------------------------------------------------------------------
/demo/qr_code.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/demo/qr_code.png
--------------------------------------------------------------------------------
/fonts/fileiconfont.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/fonts/fileiconfont.ttf
--------------------------------------------------------------------------------
/fonts/iconfont.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/fonts/iconfont.ttf
--------------------------------------------------------------------------------
/imgs/avatar_default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/imgs/avatar_default.png
--------------------------------------------------------------------------------
/imgs/default_img.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/imgs/default_img.png
--------------------------------------------------------------------------------
/imgs/github_login_ic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/imgs/github_login_ic.png
--------------------------------------------------------------------------------
/imgs/login_back.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/imgs/login_back.jpg
--------------------------------------------------------------------------------
/imgs/repo_back0.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/imgs/repo_back0.gif
--------------------------------------------------------------------------------
/imgs/repo_back1.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/imgs/repo_back1.jpeg
--------------------------------------------------------------------------------
/imgs/repo_back2.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/imgs/repo_back2.jpeg
--------------------------------------------------------------------------------
/imgs/repo_back3.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/imgs/repo_back3.jpeg
--------------------------------------------------------------------------------
/imgs/repo_back4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/imgs/repo_back4.jpg
--------------------------------------------------------------------------------
/imgs/repo_back5.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/imgs/repo_back5.jpeg
--------------------------------------------------------------------------------
/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 "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/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 |
8 |
--------------------------------------------------------------------------------
/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/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/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/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/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/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/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/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/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/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/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/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/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/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/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/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/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/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/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/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/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/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/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/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/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/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/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/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/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/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/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/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MrHGJ/FlutterGithub/72e9876f843ff9bbd4b044e0caf3bac22f5dbf47/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 | fluttergithub
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"
--------------------------------------------------------------------------------
/jsons/RepoDaoBean.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Hello-World",
3 | "full_name": "MrHGJ/FlutterGithub",
4 | "description": "This your first repo!",
5 | "language": "JavaScript",
6 | "forks_count": 9,
7 | "stargazers_count": 80,
8 | "open_issues_count": 2,
9 | "login": "octocat",
10 | "avatar_url": "https://github.com/images/error/octocat_happy.gif",
11 | "look_time": ""
12 | }
--------------------------------------------------------------------------------
/jsons/branchBean.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "dev/hgj",
3 | "protected": false
4 | }
--------------------------------------------------------------------------------
/jsons/cacheConfigBean.json:
--------------------------------------------------------------------------------
1 | {
2 | "enable": true,
3 | "maxAge": 1000,
4 | "maxCount": 100
5 | }
--------------------------------------------------------------------------------
/jsons/commitContentBean.json:
--------------------------------------------------------------------------------
1 | {
2 | "committer":"$commiterBean",
3 | "message":"Update README.md",
4 | "comment_count":0
5 | }
--------------------------------------------------------------------------------
/jsons/commitDetailBean.json:
--------------------------------------------------------------------------------
1 | {
2 | "sha": "d24e000336ae41d7f38b359c18703b65daefe449",
3 | "node_id": "MDY6Q29tbWl0MjYyMzQ2MzU0OmQyNGUwMDAzMzZhZTQxZDdmMzhiMzU5YzE4NzAzYjY1ZGFlZmU0NDk=",
4 | "commit": "$commitContentBean",
5 | "committer": "$userBean",
6 | "stats": "$commitDetailStatsBean",
7 | "files": "$[]commitDetailFileBean"
8 | }
--------------------------------------------------------------------------------
/jsons/commitDetailFileBean.json:
--------------------------------------------------------------------------------
1 | {
2 | "sha": "feec31812f476de5c8e2f765cbd7f99e738575bb",
3 | "filename": "jsons/repoBean.json",
4 | "status": "modified",
5 | "additions": 1,
6 | "deletions": 8,
7 | "changes": 9,
8 | "blob_url": "https://github.com/MrHGJ/FlutterGithub/blob/d24e000336ae41d7f38b359c18703b65daefe449/jsons/repoBean.json",
9 | "raw_url": "https://github.com/MrHGJ/FlutterGithub/raw/d24e000336ae41d7f38b359c18703b65daefe449/jsons/repoBean.json",
10 | "contents_url": "https://api.github.com/repos/MrHGJ/FlutterGithub/contents/jsons/repoBean.json?ref=d24e000336ae41d7f38b359c18703b65daefe449",
11 | "patch": ""
12 | }
--------------------------------------------------------------------------------
/jsons/commitDetailStatsBean.json:
--------------------------------------------------------------------------------
1 | {
2 | "total":919,
3 | "additions":789,
4 | "deletions":130
5 | }
--------------------------------------------------------------------------------
/jsons/commitItemBean.json:
--------------------------------------------------------------------------------
1 | {
2 | "sha":"34be3c87120650c72de7b109ea5af3b957c64a48",
3 | "commit":"$commitContentBean",
4 | "committer": "$userBean"
5 | }
--------------------------------------------------------------------------------
/jsons/commiterBean.json:
--------------------------------------------------------------------------------
1 | {
2 | "name":"GitHub",
3 | "email":"noreply@github.com",
4 | "date":"2020-05-11T07:51:12Z"
5 | }
--------------------------------------------------------------------------------
/jsons/eventBean.json:
--------------------------------------------------------------------------------
1 | {
2 | "id":"12301745966",
3 | "type":"PushEvent",
4 | "actor":"$userBean",
5 | "repo":"$repoBean",
6 | "payload":"$eventPayloadBean",
7 | "public":true,
8 | "created_at":"2020-05-11T15:52:03Z"
9 | }
--------------------------------------------------------------------------------
/jsons/eventCommitBean.json:
--------------------------------------------------------------------------------
1 | {
2 | "sha":"e5ca8bf4c1b4efa0fe095455b2525f4865308e1e",
3 | "author":"$userBean",
4 | "message":"fix: 修复repos详情页滑动冲突问题",
5 | "distinct":true,
6 | "url":"https://api.github.com/repos/MrHGJ/FlutterGithub/commits/e5ca8bf4c1b4efa0fe095455b2525f4865308e1e"
7 | }
--------------------------------------------------------------------------------
/jsons/eventPayloadBean.json:
--------------------------------------------------------------------------------
1 | {
2 | "push_id": 5054242182,
3 | "size": 1,
4 | "distinct_size": 1,
5 | "ref": "refs/heads/dev/hgj",
6 | "head": "e5ca8bf4c1b4efa0fe095455b2525f4865308e1e",
7 | "before": "48a2664b1d8c7ff1ee2683ed6ecc63ad2809b365",
8 | "commits": "$[]eventCommitBean",
9 | "ref_type": "branch",
10 | "action": "started"
11 | }
--------------------------------------------------------------------------------
/jsons/fileBean.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": ".gitignore",
3 | "path": ".gitignore",
4 | "sha": "ae1f1838ee7e87b1fa976268adc723e1020af38e",
5 | "size": 615,
6 | "url": "https://api.github.com/repos/MrHGJ/FlutterGithub/contents/.gitignore?ref=master",
7 | "html_url": "https://github.com/MrHGJ/FlutterGithub/blob/master/.gitignore",
8 | "git_url": "https://api.github.com/repos/MrHGJ/FlutterGithub/git/blobs/ae1f1838ee7e87b1fa976268adc723e1020af38e",
9 | "download_url": "https://raw.githubusercontent.com/MrHGJ/FlutterGithub/master/.gitignore",
10 | "type": "file"
11 | }
--------------------------------------------------------------------------------
/jsons/profileBean.json:
--------------------------------------------------------------------------------
1 | {
2 | "user": "$userBean",
3 | "token": "",
4 | "theme": 5678,
5 | "cache": "$cacheConfigBean",
6 | "lastLogin": "",
7 | "locale": ""
8 | }
--------------------------------------------------------------------------------
/jsons/readmeBean.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "README.md",
3 | "path": "README.md",
4 | "sha": "c9d37206693b24a6389e5b525378dbfb87beba0e",
5 | "size": 255,
6 | "url": "https://api.github.com/repos/MrHGJ/FlutterGithub/contents/README.md?ref=master",
7 | "download_url": "https://raw.githubusercontent.com/MrHGJ/FlutterGithub/master/README.md",
8 | "type": "file",
9 | "content": "IyBGbHV0dGVyR2l0aHViCueUqGZsdXR0ZXLmhaLmhaLlrozmiJDkuIDkuKpn\naXRodWLlrqLmiLfnq6/vvIzku4XnlKjkuo7lrabkuaBmbHV0dGVy77yM5Yqf\n6IO96YCQ5q2l5re75Yqg5a6M5ZaE44CCCiMj6L+H56iL5LiACjEu5a6M5oiQ\n55m75b2V6aG16Z2i5ZKM5Yqf6IO9CjIu5a6M5oiQ5oiR55qE6aG555uu5YiX\n6KGoCiMj6L+H56iL5LqMCjEu5a6M5oiQdHJlbmTmjpLooYzmppwKIyPov4fn\nqIvkuIkKMS7lrozmiJDpobnnm67or6bmg4XpobUK\n",
10 | "encoding": "base64"
11 | }
--------------------------------------------------------------------------------
/jsons/repoBean.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": 1296269,
3 | "name": "Hello-World",
4 | "full_name": "octocat/Hello-World",
5 | "owner": "$userBean",
6 | "parent": "$repoBean",
7 | "private": false,
8 | "description": "This your first repo!",
9 | "fork": false,
10 | "language": "JavaScript",
11 | "forks_count": 9,
12 | "stargazers_count": 80,
13 | "size": 108,
14 | "default_branch": "master",
15 | "open_issues_count": 2,
16 | "pushed_at": "2011-01-26T19:06:43Z",
17 | "created_at": "2011-01-26T19:01:12Z",
18 | "updated_at": "2011-01-26T19:14:43Z",
19 | "subscribers_count": 42
20 | }
--------------------------------------------------------------------------------
/jsons/repoDetailBean.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": 262346354,
3 | "node_id": "MDEwOlJlcG9zaXRvcnkyNjIzNDYzNTQ=",
4 | "name": "FlutterGithub",
5 | "full_name": "MrHGJ/FlutterGithub",
6 | "private": false,
7 | "owner": "$repoOwnerBean",
8 | "html_url": "https://github.com/MrHGJ/FlutterGithub",
9 | "description": "用flutter慢慢完成一个github客户端,仅用于学习flutter,功能逐步添加完善。",
10 | "fork": false,
11 | "created_at": "2020-05-08T14:34:19Z",
12 | "updated_at": "2020-05-10T04:15:12Z",
13 | "pushed_at": "2020-05-10T13:07:22Z",
14 | "homepage": "",
15 | "size": 104,
16 | "stargazers_count": 1,
17 | "watchers_count": 1,
18 | "language": "Dart",
19 | "has_issues": true,
20 | "has_projects": true,
21 | "has_downloads": true,
22 | "has_wiki": true,
23 | "has_pages": false,
24 | "forks_count": 0,
25 | "archived": false,
26 | "disabled": false,
27 | "open_issues_count": 0,
28 | "forks": 0,
29 | "open_issues": 0,
30 | "watchers": 1,
31 | "default_branch": "master",
32 | "network_count": 0,
33 | "subscribers_count": 0
34 | }
--------------------------------------------------------------------------------
/jsons/repoOwnerBean.json:
--------------------------------------------------------------------------------
1 | {
2 | "login": "MrHGJ",
3 | "id": 33540797,
4 | "node_id": "MDQ6VXNlcjMzNTQwNzk3",
5 | "avatar_url": "https://avatars3.githubusercontent.com/u/33540797?v=4",
6 | "gravatar_id": "",
7 | "type": "User",
8 | "site_admin": false
9 | }
--------------------------------------------------------------------------------
/jsons/trendDevSubBean.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "ink",
3 | "description": "🌈 React for interactive command-line apps",
4 | "url": "https://github.com/vadimdemedes/ink"
5 | }
--------------------------------------------------------------------------------
/jsons/trendDeveloperBean.json:
--------------------------------------------------------------------------------
1 | {
2 | "username": "philipwalton",
3 | "name": "Philip Walton",
4 | "url": "https://github.com/philipwalton",
5 | "avatar": "https://avatars0.githubusercontent.com/u/326742",
6 | "repo": "$trendDevSubBean"
7 | }
--------------------------------------------------------------------------------
/jsons/trendRepoBean.json:
--------------------------------------------------------------------------------
1 | {
2 | "author": "nhsx",
3 | "name": "COVID-19-app-iOS-BETA",
4 | "avatar": "https://github.com/nhsx.png",
5 | "url": "https://github.com/nhsx/COVID-19-app-iOS-BETA",
6 | "description": "Source code of the Beta of the NHS COVID-19 iOS app",
7 | "language": "Objective-C",
8 | "languageColor": "#438eff",
9 | "stars": 541,
10 | "forks": 98,
11 | "currentPeriodStars": 312,
12 | "builtBy": [
13 | {
14 | "username": "edent",
15 | "href": "https://github.com/edent",
16 | "avatar": "https://avatars2.githubusercontent.com/u/837136"
17 | }
18 | ]
19 | }
--------------------------------------------------------------------------------
/jsons/userBean.json:
--------------------------------------------------------------------------------
1 | {
2 | "login": "octocat",
3 | "avatar_url": "https://github.com/images/error/octocat_happy.gif",
4 | "type": "User",
5 | "name": "monalisa octocat",
6 | "company": "GitHub",
7 | "blog": "https://github.com/blog",
8 | "location": "San Francisco",
9 | "email": "octocat@github.com",
10 | "hireable": false,
11 | "bio": "There once was...",
12 | "public_repos": 2,
13 | "followers": 20,
14 | "following": 0,
15 | "created_at": "2008-01-14T04:33:35Z",
16 | "updated_at": "2008-01-14T04:33:35Z",
17 | "total_private_repos": 100,
18 | "owned_private_repos": 100
19 | }
--------------------------------------------------------------------------------
/l10n-arb/intl_messages.arb:
--------------------------------------------------------------------------------
1 | {
2 | "@@last_modified": "2020-05-21T11:14:01.431070",
3 | "title": "Flutter APP",
4 | "@title": {
5 | "description": "Title for the Demo application",
6 | "type": "text",
7 | "placeholders": {}
8 | },
9 | "home": "Github",
10 | "@home": {
11 | "type": "text",
12 | "placeholders": {}
13 | },
14 | "language": "Language",
15 | "@language": {
16 | "type": "text",
17 | "placeholders": {}
18 | },
19 | "login": "Login",
20 | "@login": {
21 | "type": "text",
22 | "placeholders": {}
23 | },
24 | "auto": "Auto",
25 | "@auto": {
26 | "type": "text",
27 | "placeholders": {}
28 | },
29 | "setting": "Setting",
30 | "@setting": {
31 | "type": "text",
32 | "placeholders": {}
33 | },
34 | "theme": "Theme",
35 | "@theme": {
36 | "type": "text",
37 | "placeholders": {}
38 | },
39 | "noDescription": "No description yet !",
40 | "@noDescription": {
41 | "type": "text",
42 | "placeholders": {}
43 | },
44 | "userName": "User Name",
45 | "@userName": {
46 | "type": "text",
47 | "placeholders": {}
48 | },
49 | "userNameRequired": "User name required!",
50 | "@userNameRequired": {
51 | "type": "text",
52 | "placeholders": {}
53 | },
54 | "password": "Password",
55 | "@password": {
56 | "type": "text",
57 | "placeholders": {}
58 | },
59 | "passwordRequired": "Password required!",
60 | "@passwordRequired": {
61 | "type": "text",
62 | "placeholders": {}
63 | },
64 | "userNameOrPasswordWrong": "User name or password is not correct!",
65 | "@userNameOrPasswordWrong": {
66 | "type": "text",
67 | "placeholders": {}
68 | },
69 | "logout": "Logout",
70 | "@logout": {
71 | "type": "text",
72 | "placeholders": {}
73 | },
74 | "logoutTip": "Are you sure you want to quit your current account?",
75 | "@logoutTip": {
76 | "type": "text",
77 | "placeholders": {}
78 | },
79 | "yes": "yes",
80 | "@yes": {
81 | "type": "text",
82 | "placeholders": {}
83 | },
84 | "cancel": "cancel",
85 | "@cancel": {
86 | "type": "text",
87 | "placeholders": {}
88 | },
89 | "test": "test",
90 | "@test": {
91 | "type": "text",
92 | "placeholders": {}
93 | },
94 | "trend": "trend",
95 | "@trend": {
96 | "type": "text",
97 | "placeholders": {}
98 | },
99 | "repos": "repos",
100 | "@repos": {
101 | "type": "text",
102 | "placeholders": {}
103 | },
104 | "developers": "developers",
105 | "@developers": {
106 | "type": "text",
107 | "placeholders": {}
108 | },
109 | "info": "info",
110 | "@info": {
111 | "type": "text",
112 | "placeholders": {}
113 | },
114 | "file": "file",
115 | "@file": {
116 | "type": "text",
117 | "placeholders": {}
118 | },
119 | "commit": "commit",
120 | "@commit": {
121 | "type": "text",
122 | "placeholders": {}
123 | },
124 | "activity": "activity",
125 | "@activity": {
126 | "type": "text",
127 | "placeholders": {}
128 | },
129 | "size": "size",
130 | "@size": {
131 | "type": "text",
132 | "placeholders": {}
133 | },
134 | "myStarRepos": "My Star",
135 | "@myStarRepos": {
136 | "type": "text",
137 | "placeholders": {}
138 | },
139 | "myFollow": "My Follow",
140 | "@myFollow": {
141 | "type": "text",
142 | "placeholders": {}
143 | },
144 | "thisProject": "This Project",
145 | "@thisProject": {
146 | "type": "text",
147 | "placeholders": {}
148 | },
149 | "repositories": "repositories",
150 | "@repositories": {
151 | "type": "text",
152 | "placeholders": {}
153 | },
154 | "footprint": "footprint",
155 | "@footprint": {
156 | "type": "text",
157 | "placeholders": {}
158 | },
159 | "me": "me",
160 | "@me": {
161 | "type": "text",
162 | "placeholders": {}
163 | }
164 | }
--------------------------------------------------------------------------------
/l10n-arb/intl_zh_CN.arb:
--------------------------------------------------------------------------------
1 | {
2 | "@@last_modified": "2019-04-30T15:02:44.753296",
3 | "title": "Github客户端",
4 | "@title": {
5 | "description": "Title for the Demo application",
6 | "type": "text",
7 | "placeholders": {}
8 | },
9 | "home": "Github客户端",
10 | "@home": {
11 | "type": "text",
12 | "placeholders": {}
13 | },
14 | "language": "语言",
15 | "@language": {
16 | "type": "text",
17 | "placeholders": {}
18 | },
19 | "login": "登录",
20 | "@login": {
21 | "type": "text",
22 | "placeholders": {}
23 | },
24 | "auto": "跟随系统",
25 | "@auto": {
26 | "type": "text",
27 | "placeholders": {}
28 | },
29 | "setting": "设置",
30 | "@setting": {
31 | "type": "text",
32 | "placeholders": {}
33 | },
34 | "theme": "换肤",
35 | "@theme": {
36 | "type": "text",
37 | "placeholders": {}
38 | },
39 | "noDescription": "暂无描述!",
40 | "@noDescription": {
41 | "type": "text",
42 | "placeholders": {}
43 | },
44 | "userName": "用户名",
45 | "@userName": {
46 | "type": "text",
47 | "placeholders": {}
48 | },
49 | "userNameRequired": "用户名不能为空",
50 | "@userNameRequired": {
51 | "type": "text",
52 | "placeholders": {}
53 | },
54 | "password": "密码",
55 | "@password": {
56 | "type": "text",
57 | "placeholders": {}
58 | },
59 | "passwordRequired": "密码不能为空",
60 | "@passwordRequired": {
61 | "type": "text",
62 | "placeholders": {}
63 | },
64 | "userNameOrPasswordWrong": "用户名或密码不正确",
65 | "@userNameOrPasswordWrong": {
66 | "type": "text",
67 | "placeholders": {}
68 | },
69 | "logout": "注销",
70 | "@logout": {
71 | "type": "text",
72 | "placeholders": {}
73 | },
74 | "logoutTip": "确定要退出当前账号吗?",
75 | "@logoutTip": {
76 | "type": "text",
77 | "placeholders": {}
78 | },
79 | "yes": "确定",
80 | "@yes": {
81 | "type": "text",
82 | "placeholders": {}
83 | },
84 | "cancel": "取消",
85 | "@cancel": {
86 | "type": "text",
87 | "placeholders": {}
88 | },
89 | "test": "测试",
90 | "@test": {
91 | "type": "text",
92 | "placeholders": {}
93 | },
94 | "trend": "排行榜",
95 | "@trend": {
96 | "type": "text",
97 | "placeholders": {}
98 | },
99 | "repos": "项目",
100 | "@repos": {
101 | "type": "text",
102 | "placeholders": {}
103 | },
104 | "developers": "开发者",
105 | "@developers": {
106 | "type": "text",
107 | "placeholders": {}
108 | },
109 | "info": "简介",
110 | "@info": {
111 | "type": "text",
112 | "placeholders": {}
113 | },
114 | "file": "文件",
115 | "@file": {
116 | "type": "text",
117 | "placeholders": {}
118 | },
119 | "commit": "提交记录",
120 | "@commit": {
121 | "type": "text",
122 | "placeholders": {}
123 | },
124 | "activity": "动态",
125 | "@activity": {
126 | "type": "text",
127 | "placeholders": {}
128 | },
129 | "size": "大小",
130 | "@size": {
131 | "type": "text",
132 | "placeholders": {}
133 | },
134 | "myStarRepos": "我star的项目",
135 | "@myStarRepos": {
136 | "type": "text",
137 | "placeholders": {}
138 | },
139 | "myFollow": "我关注的人",
140 | "@myFollow": {
141 | "type": "text",
142 | "placeholders": {}
143 | },
144 | "thisProject": "浏览本项目",
145 | "@thisProject": {
146 | "type": "text",
147 | "placeholders": {}
148 | },
149 | "repositories": "仓库",
150 | "@repositories": {
151 | "type": "text",
152 | "placeholders": {}
153 | },
154 | "footprint": "足迹",
155 | "@footprint": {
156 | "type": "text",
157 | "placeholders": {}
158 | },
159 | "me": "我的",
160 | "@me": {
161 | "type": "text",
162 | "placeholders": {}
163 | }
164 | }
--------------------------------------------------------------------------------
/lib/common/CacheObject.dart:
--------------------------------------------------------------------------------
1 | import 'dart:collection';
2 |
3 | import 'package:dio/dio.dart';
4 | import 'package:fluttergithub/common/Global.dart';
5 |
6 | class CacheObject {
7 | CacheObject(this.response)
8 | : timeStamp = DateTime.now().millisecondsSinceEpoch;
9 | Response response;
10 | int timeStamp; //缓存创建时间
11 | @override
12 | bool operator ==(other) {
13 | return response.hashCode == other.hashCode;
14 | }
15 |
16 | //将请求uri作为缓存的key
17 | @override
18 | int get hashCode => response.realUri.hashCode;
19 | }
20 |
21 | class NetCache extends Interceptor {
22 | //为确保迭代器顺序和对象插入时间一致,我们使用LinkedHashMap
23 | var cache = LinkedHashMap();
24 |
25 | @override
26 | Future onRequest(RequestOptions options) async {
27 | if (!Global.profile.cache.enable) return options;
28 | //refresh标记是否是"下拉刷新"
29 | bool refresh = options.extra["refresh"] == true;
30 | //如果是下拉刷新,先删除相关缓存
31 | if (refresh) {
32 | if (options.extra["list"] == true) {
33 | //若是列表,则只要url中包含当前path的缓存全部删除(简单实现,并不精准)
34 | cache.removeWhere((key, v) => key.contains(options.path));
35 | } else {
36 | // 如果不是列表,则只删除uri相同的缓存
37 | cache.remove(options.uri.toString());
38 | }
39 | return options;
40 | }
41 | if (options.extra["noCache"] != true &&
42 | options.method.toLowerCase() == 'get') {
43 | String key = options.extra["cacheKey"] ?? options.uri.toString();
44 | var ob = cache[key];
45 | if (ob != null) {
46 | //若缓存未过期,则返回缓存内容
47 | if ((DateTime.now().millisecondsSinceEpoch - ob.timeStamp) / 1000 <
48 | Global.profile.cache.maxAge) {
49 | return cache[key].response;
50 | } else {
51 | //若已过期则删除缓存,继续向服务器请求
52 | cache.remove(key);
53 | }
54 | }
55 | }
56 | }
57 |
58 | @override
59 | Future onError(DioError err) {
60 | // 错误状态不缓存
61 | }
62 |
63 | @override
64 | Future onResponse(Response response) {
65 | //如果启用缓存,将返回结果保存到缓存中
66 | if (Global.profile.cache.enable) {
67 | _saveCache(response);
68 | }
69 | }
70 |
71 | _saveCache(Response object) {
72 | RequestOptions options = object.request;
73 | if (options.extra["noCache"] != true &&
74 | options.method.toLowerCase() == "get") {
75 | // 如果缓存数量超过最大数量限制,则先移除最早的一条记录
76 | if (cache.length == Global.profile.cache.maxCount) {
77 | cache.remove(cache[cache.keys.first]);
78 | }
79 | String key = options.extra["cacheKey"] ?? options.uri.toString();
80 | cache[key] = CacheObject(object);
81 | }
82 | }
83 | }
84 |
--------------------------------------------------------------------------------
/lib/common/Global.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 |
3 | import 'package:flutter/material.dart';
4 | import 'package:fluttergithub/models/index.dart';
5 | import 'package:fluttergithub/res/styles.dart';
6 | import 'package:shared_preferences/shared_preferences.dart';
7 |
8 | import 'CacheObject.dart';
9 | import 'net/NetApi.dart';
10 |
11 | class Global {
12 | static SharedPreferences prefs;
13 | static ProfileBean profile = ProfileBean();
14 |
15 | //网络缓存对象
16 | static NetCache netCache = NetCache();
17 |
18 | //可选主题列表
19 | static List get themes => MyColors.themesSwatch;
20 |
21 | //是否为release版本
22 | static bool get isRelease => bool.fromEnvironment("dart.vm.product");
23 |
24 | //初始化全局信息,会在App启动时执行
25 | static Future init() async {
26 | WidgetsFlutterBinding.ensureInitialized();
27 | prefs = await SharedPreferences.getInstance();
28 | var _profile = prefs.getString("profile");
29 | if (_profile != null) {
30 | try {
31 | profile = ProfileBean.fromJson(jsonDecode(_profile));
32 | } catch (e) {
33 | print(e);
34 | }
35 | }
36 | //如果没有缓存策略,设置默认缓存策略
37 | profile.cache = profile.cache ?? CacheConfigBean()
38 | ..enable = true
39 | ..maxAge = 3600
40 | ..maxCount = 100;
41 | //初始化网络请求相关配置
42 | NetApi.init();
43 | }
44 |
45 | //持久化Profile信息
46 | static saveProfile() =>
47 | prefs.setString("profile", jsonEncode(profile.toJson()));
48 | }
49 |
--------------------------------------------------------------------------------
/lib/common/constant/constant.dart:
--------------------------------------------------------------------------------
1 | class Constant{
2 | /// //////////////////////////////////////常量////////////////////////////////////// ///
3 | static const BASE_URL = 'https://api.github.com';
4 |
5 | /// //////////////////////////////////////SharedPreference////////////////////////////////////// ///
6 | static const USER_LOGIN_KEY = 'userLogin'; //这个是用户登录时输入框中填入的用户名
7 | static const PASSWORD_KEY = 'password';
8 | static const USER_NAME_KEY = 'username'; //这个是用户登录成功后从后台获取的真正用户名
9 | static const BASIC_KEY = 'basic';
10 | static const IS_LOGIN_KEY = 'isLogin';
11 | static const SEARCH_HISTORY_KEY = 'search_history';
12 | }
--------------------------------------------------------------------------------
/lib/common/constant/ignore.dart:
--------------------------------------------------------------------------------
1 | class Ignore {
2 | //注册自己的OAuth Application,得到clientId和clientSecret,进行替换
3 | //注册地址: https://github.com/settings/applications/new
4 | static const String clientId = 'xxxxxxxxxxxxxxx';
5 | static const String clientSecret ='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
6 | }
--------------------------------------------------------------------------------
/lib/common/delegate/index.dart:
--------------------------------------------------------------------------------
1 | export 'sliver_delegate.dart';
--------------------------------------------------------------------------------
/lib/common/delegate/sliver_delegate.dart:
--------------------------------------------------------------------------------
1 | import 'dart:math';
2 | import 'package:flutter/material.dart';
3 |
4 | class MySliverPersistentHeaderDelegate extends SliverPersistentHeaderDelegate {
5 | MySliverPersistentHeaderDelegate(
6 | {@required this.minHeight,
7 | @required this.maxHeight,
8 | @required this.child});
9 |
10 | final double minHeight;
11 | final double maxHeight;
12 | final Widget child;
13 |
14 | @override
15 | double get minExtent => minHeight;
16 |
17 | @override
18 | double get maxExtent => max(maxHeight, minHeight);
19 |
20 | @override
21 | Widget build(
22 | BuildContext context, double shrinkOffset, bool overlapsContent) {
23 | return new SizedBox.expand(
24 | child: child,
25 | );
26 | }
27 |
28 | @override
29 | bool shouldRebuild(MySliverPersistentHeaderDelegate oldDelegate) {
30 | return maxHeight != oldDelegate.maxExtent ||
31 | minHeight != oldDelegate.minExtent||child!=oldDelegate.child;
32 | }
33 | }
--------------------------------------------------------------------------------
/lib/common/event/event_bus.dart:
--------------------------------------------------------------------------------
1 | //创建EventBus
2 | import 'package:event_bus/event_bus.dart';
3 |
4 | EventBus eventBus = EventBus();
5 |
6 | //切换分支事件
7 | class BranchSwitchEvent {
8 | String curBranch;
9 |
10 | BranchSwitchEvent(this.curBranch);
11 | }
12 |
13 | //搜索事件
14 | class SearchEvent {
15 | String searchWords;
16 | SearchEvent({this.searchWords});
17 | }
18 |
--------------------------------------------------------------------------------
/lib/common/myAvatar.dart:
--------------------------------------------------------------------------------
1 | import 'package:cached_network_image/cached_network_image.dart';
2 | import 'package:flutter/cupertino.dart';
3 |
4 | Widget myAvatar(String url,{
5 | double width = 30,
6 | double height,
7 | BoxFit fit,
8 | BorderRadius borderRadius,
9 | }){
10 | var placeholder = Image.asset(
11 | "imgs/avatar_default.png", //头像占位图,加载过程中显示
12 | width: width,
13 | height: height
14 | );
15 | return ClipRRect(
16 | borderRadius: borderRadius??BorderRadius.circular(2),
17 | child: CachedNetworkImage(
18 | imageUrl: url,
19 | width: width,
20 | height: height,
21 | fit: fit,
22 | placeholder: (context, url) =>placeholder,
23 | errorWidget: (context, url, error) =>placeholder,
24 | ),
25 | );
26 | }
--------------------------------------------------------------------------------
/lib/common/net/api.dart:
--------------------------------------------------------------------------------
1 | import 'package:fluttergithub/common/constant/constant.dart';
2 |
3 | class Api {
4 | //GitHub API OAuth认证
5 | static getAuthorizations() {
6 | return Constant.BASE_URL + "/authorizations";
7 | }
8 |
9 | //用户登录获取用户信息
10 | static getUser(String username) {
11 | return Constant.BASE_URL + "/users/$username";
12 | }
13 |
14 | //获取用户项目列表
15 | static getRepos(String userName) {
16 | return Constant.BASE_URL + "/users/$userName/repos";
17 | }
18 |
19 | //获取项目详情
20 | static getRepoDetail(String repoOwner, String repoName) {
21 | return Constant.BASE_URL + "/repos/$repoOwner/$repoName";
22 | }
23 |
24 | //Star仓库的人 get
25 | static getRepoStargazers(reposOwner, reposName) {
26 | return "${Constant.BASE_URL}/repos/$reposOwner/$reposName/stargazers";
27 | }
28 |
29 | //Watch仓库的人 get
30 | static getRepoWatchers(reposOwner, reposName) {
31 | return "${Constant.BASE_URL}/repos/$reposOwner/$reposName/subscribers";
32 | }
33 |
34 | //获取当前项目分支
35 | static getBranch(String repoOwner, String repoName) {
36 | return '${Constant.BASE_URL}/repos/$repoOwner/$repoName/branches';
37 | }
38 |
39 | //获取Readme.md内容
40 | static getReadme(String repoOwner, String repoName) {
41 | return "${Constant.BASE_URL}/repos/$repoOwner/$repoName/readme";
42 | }
43 |
44 | //获取commits列表
45 | static getRepoCommits(String repoOwner, String repoName) {
46 | return "${Constant.BASE_URL}/repos/$repoOwner/$repoName/commits";
47 | }
48 |
49 | //获取commits详情列表
50 | static getRepoCommitsDetail(String repoOwner, String repoName, String sha) {
51 | return "${Constant.BASE_URL}/repos/$repoOwner/$repoName/commits/$sha";
52 | }
53 |
54 | //获取项目动态列表
55 | static getRepoEvents(String repoOwner, String repoName) {
56 | return "${Constant.BASE_URL}/repos/$repoOwner/$repoName/events";
57 | }
58 |
59 | //获取仓库下路径的内容
60 | static getRepoContent(String repoOwner, String repoName, String path) {
61 | return "${Constant.BASE_URL}/repos/$repoOwner/$repoName/contents/$path";
62 | }
63 |
64 | //获取用户starred项目列表
65 | static getStarredRepos(String userName) {
66 | return "${Constant.BASE_URL}/users/$userName/starred";
67 | }
68 |
69 | //获取用户动态列表
70 | static getUserEvents(String userName) {
71 | return "${Constant.BASE_URL}/users/$userName/events";
72 | }
73 |
74 | //userName关注的人
75 | static getUserFollowing(userName) {
76 | return "${Constant.BASE_URL}/users/$userName/following?";
77 | }
78 |
79 | //关注userName的人(粉丝)
80 | static getUserFollower(userName) {
81 | return "${Constant.BASE_URL}/users/$userName/followers?";
82 | }
83 |
84 | ///搜索
85 | ///type: repositories(搜索仓库),users(搜索用户)
86 | ///searchWords: 搜索的关键词
87 | ///sort: 排序的方式,例如Best Match, Most Stars...
88 | ///order : desc(降序), asc(升序)
89 | static search(type, searchWords, sort, order) {
90 | return "${Constant.BASE_URL}/search/$type?q=$searchWords&sort=$sort&order=$order";
91 | }
92 |
93 | //趋势项目
94 | static getTrendingRepos(String since, String language) {
95 | return "https://github-trending-api.now.sh/repositories?language=$language&since=$since";
96 | }
97 |
98 | //趋势用户
99 | static getTrendDevelopers(String since, String language) {
100 | return 'https://github-trending-api.now.sh/developers?language=$language&since=$since';
101 | }
102 |
103 | //判断当前项目是否star
104 | static isStarred(String repoOwner, String repoName) {
105 | return "${Constant.BASE_URL}/user/starred/$repoOwner/$repoName";
106 | }
107 |
108 | //判断当前developer是否已follow
109 | static isFollowing(String developerName) {
110 | return "${Constant.BASE_URL}/user/following/$developerName";
111 | }
112 | }
113 |
--------------------------------------------------------------------------------
/lib/common/util/CommonUtil.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 |
3 | import 'package:flutter/material.dart';
4 | import 'package:fluttertoast/fluttertoast.dart';
5 |
6 | void showToast(String msg) {
7 | Fluttertoast.showToast(
8 | msg: msg,
9 | toastLength: Toast.LENGTH_SHORT,
10 | gravity: ToastGravity.CENTER,
11 | timeInSecForIos: 1,
12 | backgroundColor: Colors.black.withAlpha(158),
13 | textColor: Colors.white,
14 | fontSize: 16.0);
15 | }
16 |
17 | void showLongToast(String msg) {
18 | Fluttertoast.showToast(
19 | msg: msg,
20 | toastLength: Toast.LENGTH_LONG,
21 | gravity: ToastGravity.CENTER,
22 | timeInSecForIos: 1,
23 | backgroundColor: Colors.black.withAlpha(158),
24 | textColor: Colors.white,
25 | fontSize: 16.0);
26 | }
27 |
28 | void showLoading(context, [String text]) {
29 | text = text ?? "Loading...";
30 | showDialog(
31 | barrierDismissible: false,
32 | context: context,
33 | builder: (context) {
34 | return Center(
35 | child: Container(
36 | decoration: BoxDecoration(
37 | color: Colors.white,
38 | borderRadius: BorderRadius.circular(3.0),
39 | boxShadow: [
40 | //阴影
41 | BoxShadow(
42 | color: Colors.black12,
43 | //offset: Offset(2.0,2.0),
44 | blurRadius: 10.0,
45 | )
46 | ]),
47 | padding: EdgeInsets.all(16),
48 | margin: EdgeInsets.all(16),
49 | constraints: BoxConstraints(minHeight: 120, minWidth: 180),
50 | child: Column(
51 | mainAxisSize: MainAxisSize.min,
52 | mainAxisAlignment: MainAxisAlignment.center,
53 | children: [
54 | SizedBox(
55 | height: 30,
56 | width: 30,
57 | child: CircularProgressIndicator(
58 | strokeWidth: 3,
59 | ),
60 | ),
61 | Padding(
62 | padding: const EdgeInsets.only(top: 20.0),
63 | child: Text(
64 | text,
65 | style: Theme.of(context).textTheme.body2,
66 | ),
67 | ),
68 | ],
69 | ),
70 | ),
71 | );
72 | });
73 | }
74 |
75 | //获取屏幕宽
76 | double getScreenWidth(BuildContext context) {
77 | return MediaQuery.of(context).size.width;
78 | }
79 |
80 | //获取屏幕高
81 | double getScreenHeight(BuildContext context) {
82 | return MediaQuery.of(context).size.height;
83 | }
84 |
85 | //Base64加密
86 | String encodeBase64(String data) {
87 | var content = utf8.encode(data);
88 | return base64Encode(content);
89 | }
90 |
91 | //Base64解密
92 | String decodeBase64(String data) {
93 | return utf8.decode(base64Decode(data));
94 | }
95 |
96 | ///判断文件是否是Image类型
97 | const IMAGE_END = [".png", ".jpg", ".jpeg", ".gif", ".svg"];
98 |
99 | isImageEnd(String path) {
100 | bool image = false;
101 | for (String item in IMAGE_END) {
102 | if (path.indexOf(item) + item.length == path.length) {
103 | image = true;
104 | }
105 | }
106 | return image;
107 | }
108 |
109 | //计算文件大小
110 | calculateFileSize(int fileByte) {
111 | if (fileByte < 1024) {
112 | return fileByte.toString() + " B";
113 | } else if (fileByte < 1024 * 1024) {
114 | return keepDecimal(fileByte / 1024) + " KB";
115 | } else if (fileByte < 1024 * 1024 * 1024) {
116 | return keepDecimal(fileByte / 1024 / 1024) + " M";
117 | } else {
118 | return keepDecimal(fileByte / 1024 / 1024 / 1024) + " G";
119 | }
120 | }
121 |
122 | //保留两位小数
123 | keepDecimal(double data) {
124 | String str = data.toString();
125 | String decimal;
126 | if (str.contains('.')) {
127 | var arry = str.split('.');
128 | decimal = arry[1].toString();
129 | if (decimal.length > 2) {
130 | decimal = decimal.substring(0, 2);
131 | }
132 | return arry[0].toString() + '.' + decimal;
133 | } else {
134 | return str;
135 | }
136 | }
137 |
138 | ///跳转页面
139 | goToPage({@required BuildContext context, @required Widget page}) {
140 | Navigator.push(
141 | context,
142 | MaterialPageRoute(
143 | builder: (context) => page,
144 | ),
145 | );
146 | }
147 |
--------------------------------------------------------------------------------
/lib/common/util/RelativeDateUtil.dart:
--------------------------------------------------------------------------------
1 | class RelativeDateFormat {
2 | static final num ONE_MINUTE = 60000;
3 | static final num ONE_HOUR = 3600000;
4 | static final num ONE_DAY = 86400000;
5 | static final num ONE_WEEK = 604800000;
6 |
7 | static final String ONE_SECOND_AGO = " 秒前";
8 | static final String ONE_MINUTE_AGO = " 分钟前";
9 | static final String ONE_HOUR_AGO = " 小时前";
10 | static final String ONE_DAY_AGO = " 天前";
11 | static final String ONE_MONTH_AGO = " 月前";
12 | static final String ONE_YEAR_AGO = " 年前";
13 |
14 | //时间转换
15 | static String format(DateTime date) {
16 | num delta =
17 | DateTime.now().millisecondsSinceEpoch - date.millisecondsSinceEpoch;
18 | if (delta < 1 * ONE_MINUTE) {
19 | num seconds = toSeconds(delta);
20 | return (seconds <= 0 ? 1 : seconds).toInt().toString() + ONE_SECOND_AGO;
21 | }
22 | if (delta < 45 * ONE_MINUTE) {
23 | num minutes = toMinutes(delta);
24 | return (minutes <= 0 ? 1 : minutes).toInt().toString() + ONE_MINUTE_AGO;
25 | }
26 | if (delta < 24 * ONE_HOUR) {
27 | num hours = toHours(delta);
28 | return (hours <= 0 ? 1 : hours).toInt().toString() + ONE_HOUR_AGO;
29 | }
30 | if (delta < 48 * ONE_HOUR) {
31 | return "昨天";
32 | }
33 | if (delta < 30 * ONE_DAY) {
34 | num days = toDays(delta);
35 | return (days <= 0 ? 1 : days).toInt().toString() + ONE_DAY_AGO;
36 | }
37 | if (delta < 12 * 4 * ONE_WEEK) {
38 | num months = toMonths(delta);
39 | return (months <= 0 ? 1 : months).toInt().toString() + ONE_MONTH_AGO;
40 | } else {
41 | num years = toYears(delta);
42 | return (years <= 0 ? 1 : years).toInt().toString() + ONE_YEAR_AGO;
43 | }
44 | }
45 |
46 | static num toSeconds(num date) {
47 | return date / 1000;
48 | }
49 |
50 | static num toMinutes(num date) {
51 | return toSeconds(date) / 60;
52 | }
53 |
54 | static num toHours(num date) {
55 | return toMinutes(date) / 60;
56 | }
57 |
58 | static num toDays(num date) {
59 | return toHours(date) / 24;
60 | }
61 |
62 | static num toMonths(num date) {
63 | return toDays(date) / 30;
64 | }
65 |
66 | static num toYears(num date) {
67 | return toMonths(date) / 365;
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/lib/db/dao/repo_history_dao.dart:
--------------------------------------------------------------------------------
1 | import 'package:fluttergithub/db/db_provider.dart';
2 | import 'package:fluttergithub/models/index.dart';
3 | import 'package:sqflite/sqflite.dart';
4 |
5 | class RepoHistoryDao extends BaseDBProvider {
6 | ///表名
7 | final String name = "ReposHistory";
8 |
9 | ///表主键字段
10 | final String columnId = "_id";
11 |
12 | @override
13 | tableName() {
14 | return name;
15 | }
16 |
17 | @override
18 | tableSqlString() {
19 | return tableBaseString(name, columnId) +
20 | '''
21 | name text,
22 | full_name text,
23 | description text,
24 | language text,
25 | forks_count integer,
26 | stargazers_count integer,
27 | open_issues_count integer,
28 | login text,
29 | avatar_url text,
30 | look_time text)
31 | ''';
32 | }
33 |
34 | ///
35 | /// 插入数据
36 | ///
37 | Future insert(RepoDaoBean repoData) async {
38 | Database db = await getDB();
39 | bool repoIsExist = await getRepoIsExistByFullName(repoData.full_name);
40 | //如果repo已经存在,先删除
41 | if (repoIsExist) {
42 | await db.delete(name,
43 | where: "full_name = ?", whereArgs: [repoData.full_name]);
44 | }
45 | return await db.insert(name, repoData.toJson());
46 | }
47 |
48 | ///
49 | /// 获取当前浏览的Repo是否存在
50 | ///
51 | Future getRepoIsExistByFullName(String fullName) async {
52 | Database db = await getDB();
53 | List