├── .github
├── FUNDING.yml
└── workflows
│ └── ci.yml
├── .gitignore
├── .metadata
├── 1.jpg
├── 2.jpg
├── 3.jpg
├── LICENSE
├── README.md
├── README_EN.md
├── RECORD.md
├── VERSION.md
├── analysis_options.yaml
├── android
├── .gitignore
├── app
│ ├── build.gradle
│ ├── exported.gradle
│ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── kotlin
│ │ └── com
│ │ │ └── shuyu
│ │ │ └── gsygithub
│ │ │ └── gsygithubappflutter
│ │ │ ├── MainActivity.kt
│ │ │ └── UpdateAlbumPlugin.kt
│ │ └── res
│ │ ├── drawable
│ │ ├── launch_background.xml
│ │ └── normal_background.xml
│ │ ├── mipmap-hdpi
│ │ ├── ic_launcher.png
│ │ └── launch_image.png
│ │ ├── mipmap-mdpi
│ │ ├── ic_launcher.png
│ │ └── launch_image.png
│ │ ├── mipmap-xhdpi
│ │ ├── ic_launcher.png
│ │ └── launch_image.png
│ │ ├── mipmap-xxhdpi
│ │ ├── ic_launcher.png
│ │ └── launch_image.png
│ │ ├── mipmap-xxxhdpi
│ │ ├── ic_launcher.png
│ │ └── launch_image.png
│ │ └── values
│ │ └── styles.xml
├── build.gradle
├── gradle.properties
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── gsygithubapp-debug.jks
└── settings.gradle
├── devtools_options.yaml
├── download.png
├── folder.png
├── framework2.png
├── googleplay.png
├── ios.gif
├── ios
├── .gitignore
├── Flutter
│ ├── AppFrameworkInfo.plist
│ ├── Debug.xcconfig
│ └── Release.xcconfig
├── Podfile
├── Podfile.lock
├── Runner.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ └── IDEWorkspaceChecks.plist
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── Runner.xcscheme
├── Runner.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
└── Runner
│ ├── AppDelegate.swift
│ ├── Assets.xcassets
│ ├── AppIcon.appiconset
│ │ ├── 120.jpg
│ │ ├── 152.jpg
│ │ ├── 167.jpg
│ │ ├── 180.png
│ │ ├── 40.png
│ │ ├── 58.png
│ │ ├── 60.jpg
│ │ ├── 76.png
│ │ ├── 80.jpg
│ │ ├── 87.jpg
│ │ ├── Contents.json
│ │ ├── logo-4.png
│ │ └── logo2x-3.jpg
│ ├── Contents.json
│ └── LaunchImage.imageset
│ │ ├── Contents.json
│ │ ├── Default@2x.png
│ │ ├── Default@3x-1.png
│ │ ├── Default@3x-2.png
│ │ ├── Default@3x-3.png
│ │ ├── Default@3x-4.png
│ │ └── Default@3x.png
│ ├── Base.lproj
│ ├── LaunchScreen.storyboard
│ └── Main.storyboard
│ ├── Info.plist
│ └── Runner-Bridging-Header.h
├── ios_wait.png
├── l10n.yaml
├── lib
├── app.dart
├── common
│ ├── config
│ │ └── config.dart
│ ├── event
│ │ ├── event_bus.dart
│ │ ├── http_error_event.dart
│ │ └── index.dart
│ ├── local
│ │ └── local_storage.dart
│ ├── localization
│ │ ├── extension.dart
│ │ └── l10n
│ │ │ ├── app_en.arb
│ │ │ ├── app_ja.arb
│ │ │ ├── app_ko.arb
│ │ │ ├── app_localizations.dart
│ │ │ ├── app_localizations_en.dart
│ │ │ ├── app_localizations_ja.dart
│ │ │ ├── app_localizations_ko.dart
│ │ │ ├── app_localizations_zh.dart
│ │ │ └── app_zh.arb
│ ├── logger.dart
│ ├── net
│ │ ├── address.dart
│ │ ├── api.dart
│ │ ├── code.dart
│ │ ├── graphql
│ │ │ ├── client.dart
│ │ │ ├── repositories.dart
│ │ │ └── users.dart
│ │ ├── interceptors
│ │ │ ├── error_interceptor.dart
│ │ │ ├── header_interceptor.dart
│ │ │ ├── log_interceptor.dart
│ │ │ ├── response_interceptor.dart
│ │ │ └── token_interceptor.dart
│ │ ├── result_data.dart
│ │ ├── transformer.dart
│ │ ├── transformer.g.dart
│ │ └── trending
│ │ │ └── github_trending.dart
│ ├── repositories
│ │ ├── data_result.dart
│ │ ├── event_repository.dart
│ │ ├── issue_repository.dart
│ │ ├── repos_repository.dart
│ │ └── user_repository.dart
│ ├── router
│ │ └── anima_route.dart
│ ├── style
│ │ └── gsy_style.dart
│ ├── toast.dart
│ └── utils
│ │ ├── code_utils.dart
│ │ ├── common_utils.dart
│ │ ├── event_utils.dart
│ │ ├── html_utils.dart
│ │ └── navigator_utils.dart
├── db
│ ├── provider
│ │ ├── event
│ │ │ ├── received_event_db_provider.dart
│ │ │ └── user_event_db_provider.dart
│ │ ├── issue
│ │ │ ├── issue_comment_db_provider.dart
│ │ │ └── issue_detail_db_provider.dart
│ │ ├── repos
│ │ │ ├── read_history_db_provider.dart
│ │ │ ├── repository_branch_db_provider.dart
│ │ │ ├── repository_commitInfo_detail_db_provider.dart
│ │ │ ├── repository_commits_db_provider.dart
│ │ │ ├── repository_detail_db_provider.dart
│ │ │ ├── repository_detail_readme_db_provider.dart
│ │ │ ├── repository_event_db_provider.dart
│ │ │ ├── repository_fork_db_provider.dart
│ │ │ ├── repository_issue_db_provider.dart
│ │ │ ├── repository_pulse_db_provider.dart
│ │ │ ├── repository_star_db_provider.dart
│ │ │ ├── repository_watcher_db_provider.dart
│ │ │ └── trend_repository_db_provider.dart
│ │ └── user
│ │ │ ├── org_member_db_provider.dart
│ │ │ ├── user_followed_db_provider.dart
│ │ │ ├── user_follower_db_provider.dart
│ │ │ ├── user_orgs_db_provider.dart
│ │ │ ├── user_repos_db_provider.dart
│ │ │ ├── user_stared_db_provider.dart
│ │ │ └── userinfo_db_provider.dart
│ ├── sql_manager.dart
│ └── sql_provider.dart
├── env
│ ├── config_wrapper.dart
│ ├── dev.dart
│ ├── dev.g.dart
│ ├── env_config.dart
│ ├── env_config.g.dart
│ ├── env_json_dev.json
│ ├── env_json_prod.json
│ ├── prod.dart
│ └── prod.g.dart
├── main.dart
├── main_prod.dart
├── model
│ ├── branch.dart
│ ├── branch.g.dart
│ ├── commitFile.dart
│ ├── commitFile.g.dart
│ ├── commit_comment.dart
│ ├── commit_comment.g.dart
│ ├── commit_git_info.dart
│ ├── commit_git_info.g.dart
│ ├── commit_git_user.dart
│ ├── commit_git_user.g.dart
│ ├── commit_stats.dart
│ ├── commit_stats.g.dart
│ ├── commits_comparison.dart
│ ├── commits_comparison.g.dart
│ ├── common_list_datatype.dart
│ ├── download_source.dart
│ ├── download_source.g.dart
│ ├── event.dart
│ ├── event.g.dart
│ ├── event_payload.dart
│ ├── event_payload.g.dart
│ ├── file_model.dart
│ ├── file_model.g.dart
│ ├── issue.dart
│ ├── issue.g.dart
│ ├── issue_event.dart
│ ├── issue_event.g.dart
│ ├── license.dart
│ ├── license.g.dart
│ ├── notification.dart
│ ├── notification.g.dart
│ ├── notification_subject.dart
│ ├── notification_subject.g.dart
│ ├── push_commit.dart
│ ├── push_commit.g.dart
│ ├── push_event_commit.dart
│ ├── push_event_commit.g.dart
│ ├── release.dart
│ ├── release.g.dart
│ ├── release_asset.dart
│ ├── release_asset.g.dart
│ ├── repo_commit.dart
│ ├── repo_commit.g.dart
│ ├── repository.dart
│ ├── repository.g.dart
│ ├── repository_permissions.dart
│ ├── repository_permissions.g.dart
│ ├── repository_ql.dart
│ ├── search_user_ql.dart
│ ├── template.dart
│ ├── template.g.dart
│ ├── trending_repo_model.dart
│ ├── trending_repo_model.g.dart
│ ├── user.dart
│ ├── user.g.dart
│ ├── user_org.dart
│ └── user_org.g.dart
├── page
│ ├── code_detail_page_web.dart
│ ├── common_list_page.dart
│ ├── debug
│ │ ├── debug_data_page.dart
│ │ └── debug_label.dart
│ ├── dynamic
│ │ ├── dynamic_bloc.dart
│ │ └── dynamic_page.dart
│ ├── error_page.dart
│ ├── gsy_webview.dart
│ ├── home
│ │ ├── home_page.dart
│ │ └── widget
│ │ │ └── home_drawer.dart
│ ├── honor_list_page.dart
│ ├── issue
│ │ ├── issue_detail_page.dart
│ │ ├── issue_edit_dIalog.dart
│ │ └── widget
│ │ │ ├── issue_header_item.dart
│ │ │ └── issue_item.dart
│ ├── login
│ │ ├── login_page.dart
│ │ └── login_webview.dart
│ ├── my_page.dart
│ ├── notify
│ │ └── notify_page.dart
│ ├── photoview_page.dart
│ ├── push
│ │ ├── push_detail_page.dart
│ │ └── widget
│ │ │ ├── push_coed_item.dart
│ │ │ └── push_header.dart
│ ├── release
│ │ ├── release_page.dart
│ │ └── widget
│ │ │ └── release_item.dart
│ ├── repos
│ │ ├── provider
│ │ │ ├── repos_detail_provider.dart
│ │ │ └── repos_network_provider.dart
│ │ ├── repository_detail_issue_list_page.dart
│ │ ├── repository_detail_page.dart
│ │ ├── repository_detail_readme_page.dart
│ │ ├── repository_file_list_page.dart
│ │ ├── repostory_detail_info_page.dart
│ │ └── widget
│ │ │ ├── repos_header_item.dart
│ │ │ └── repos_item.dart
│ ├── search
│ │ ├── search_bloc.dart
│ │ ├── search_page.dart
│ │ └── widget
│ │ │ ├── gsy_search_drawer.dart
│ │ │ └── gsy_search_input_widget.dart
│ ├── trend
│ │ ├── trend_page.dart
│ │ ├── trend_provider.dart
│ │ ├── trend_user_page.dart
│ │ ├── trend_user_provider.dart
│ │ └── trend_user_provider.g.dart
│ ├── user
│ │ ├── base_person_provider.dart
│ │ ├── base_person_provider.g.dart
│ │ ├── base_person_state.dart
│ │ ├── person_page.dart
│ │ └── widget
│ │ │ ├── user_header.dart
│ │ │ └── user_item.dart
│ ├── user_profile_page.dart
│ └── welcome_page.dart
├── provider
│ ├── app_state_provider.dart
│ └── app_state_provider.g.dart
├── redux
│ ├── gsy_state.dart
│ ├── login_redux.dart
│ ├── middleware
│ │ ├── combine_epics.dart
│ │ ├── epic.dart
│ │ ├── epic_middleware.dart
│ │ └── epic_store.dart
│ └── user_redux.dart
├── test
│ ├── demo_app.dart
│ ├── demo_appbar.dart
│ ├── demo_bloc_page.dart
│ ├── demo_db.dart
│ ├── demo_item.dart
│ ├── demo_mixins.dart
│ ├── demo_page.dart
│ ├── demo_tab_page.dart
│ ├── demo_text_field_page.dart
│ ├── demo_user_store.dart
│ └── demo_widget.dart
└── widget
│ ├── anima
│ └── curves_bezier.dart
│ ├── animated_background.dart
│ ├── diff_scale_text.dart
│ ├── flutter_json_widget.dart
│ ├── gsy_bottom_action_bar.dart
│ ├── gsy_card_item.dart
│ ├── gsy_common_option_widget.dart
│ ├── gsy_event_item.dart
│ ├── gsy_flex_button.dart
│ ├── gsy_icon_text.dart
│ ├── gsy_input_widget.dart
│ ├── gsy_select_item_widget.dart
│ ├── gsy_tabbar_widget.dart
│ ├── gsy_tabs.dart
│ ├── gsy_title_bar.dart
│ ├── gsy_user_icon_widget.dart
│ ├── markdown
│ ├── gsy_markdown_widget.dart
│ └── syntax_high_lighter.dart
│ ├── menu
│ ├── flutter_radial_menu.dart
│ └── src
│ │ ├── arc_progress_indicator.dart
│ │ ├── radial_menu.dart
│ │ ├── radial_menu_button.dart
│ │ ├── radial_menu_center_button.dart
│ │ └── radial_menu_item.dart
│ ├── mole_widget.dart
│ ├── never_overscroll_indicator.dart
│ ├── only_share_widget.dart
│ ├── particle
│ ├── particle_model.dart
│ ├── particle_painter.dart
│ └── particle_widget.dart
│ ├── pull
│ ├── custom_bouncing_scroll_physics.dart
│ ├── gsy_flare_mutli_pull_controller.dart
│ ├── gsy_flare_pull_controller.dart
│ ├── gsy_pull_load_widget.dart
│ ├── gsy_pull_new_load_widget.dart
│ ├── gsy_refresh_sliver.dart
│ └── nested
│ │ ├── gsy_nested_pull_load_widget.dart
│ │ ├── gsy_sliver_header_delegate.dart
│ │ └── nested_refresh.dart
│ └── state
│ └── gsy_list_state.dart
├── logo.png
├── p1.png
├── p2.png
├── p3.png
├── p4.png
├── pubspec.lock
├── pubspec.yaml
├── register0.png
├── register1.jpg
├── static
├── file
│ ├── Space-Demo.flr
│ ├── flare_flutter_logo_.flr
│ ├── launch.riv
│ ├── loading_world_now.flr
│ ├── rejection.json
│ ├── rejection2.json
│ ├── search.json
│ └── user.json
├── font
│ ├── akronim.ttf
│ ├── demo.css
│ ├── demo_fontclass.html
│ ├── demo_symbol.html
│ ├── demo_unicode.html
│ ├── google_kavivanar.ttf
│ ├── iconfont.css
│ ├── iconfont.eot
│ ├── iconfont.js
│ ├── iconfont.svg
│ ├── iconfont.ttf
│ └── iconfont.woff
└── images
│ ├── default_img.png
│ ├── logo.png
│ └── welcome.png
├── thanks.jpg
└── theme.gif
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # These are supported funding model platforms
2 |
3 | custom: http://img.cdn.guoshuyu.cn/thanks.jpg
4 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | .dart_tool/
3 |
4 | .packages
5 | .pub/
6 |
7 | build/
8 |
9 | .flutter-plugins
10 | .flutter-plugins-dependencies
11 |
12 | .gradle/
13 |
14 | ignoreConfig.dart
15 |
16 | flutter_export_environment.sh
17 |
18 | # Miscellaneous
19 | *.class
20 | *.log
21 | *.pyc
22 | *.swp
23 | .atom/
24 | .buildlog/
25 | .history
26 | .svn/
27 |
28 | # IntelliJ related
29 | *.iml
30 | *.ipr
31 | *.iws
32 | .idea/
33 |
34 | # The .vscode folder contains launch configuration and tasks you configure in
35 | # VS Code which you may wish to be included in version control, so this line
36 | # is commented out by default.
37 | #.vscode/
38 |
39 | # Flutter/Dart/Pub related
40 | **/doc/api/
41 | **/ios/Flutter/.last_build_id
42 |
43 | .pub-cache/
44 | /build/
45 |
46 | # Web related
47 | lib/generated_plugin_registrant.dart
48 |
49 | # Symbolication related
50 | app.*.symbols
51 |
52 | # Obfuscation related
53 | app.*.map.json
54 |
55 | # Exceptions to above rules.
56 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
--------------------------------------------------------------------------------
/.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: 18cd7a3601bcffb36fdf2f679f763b5e827c2e8e
8 | channel: unknown
9 |
10 | project_type: app
11 |
--------------------------------------------------------------------------------
/1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CarGuo/gsy_github_app_flutter/263497b5f78a63d8e775b229528b35ced177e1b8/1.jpg
--------------------------------------------------------------------------------
/2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CarGuo/gsy_github_app_flutter/263497b5f78a63d8e775b229528b35ced177e1b8/2.jpg
--------------------------------------------------------------------------------
/3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CarGuo/gsy_github_app_flutter/263497b5f78a63d8e775b229528b35ced177e1b8/3.jpg
--------------------------------------------------------------------------------
/VERSION.md:
--------------------------------------------------------------------------------
1 |
2 | ### 请直接看 github release
3 |
4 | ### 1.1.9
5 |
6 | * 修正弹出键盘的时候被挤压问题
7 | * 修复切换主题导致长按输入框弹出异常
8 | * 修复其他小问题。
9 |
10 |
11 | ### 1.1.8
12 |
13 | * 修复反馈输入框遮挡问题。
14 | * 更新部分插件,更新了 sdk 到 1.1.9
15 |
16 | ### 1.1.7
17 |
18 | * 更新flutter SDK 到 1.1.3 版本,修复TargetSDK 28以上在9.0键盘无法弹出问题。
19 |
20 |
21 |
22 | ### 1.1.6
23 | * flutter升级正式版1.0
24 |
25 |
26 | ### 1.1.5
27 |
28 | * Android 代码详情使用 AndroidView 实现WebView
29 | * 升级flutter Sdk
30 | * 升级第三方包
31 |
32 | ### 1.1.3
33 | * 修复详情tab切换问题。
34 |
35 | ### 1.1.2
36 | * 增加滑动返回。
37 | * 修复主页抽屉小屏幕无法滚动。
38 | * 增加部分代码高亮。
39 | * 修复搜索排序按键问题。
40 | * 更新flutter SDK
41 |
42 |
43 | ### 1.1.1
44 | * 更新flutter SDK 0.5.8。
45 | * 修复一些仓库下的readme问题。
46 |
47 | ### 1.1.0
48 | * 切换用户切换数据库。
49 | * 多语言。
50 |
51 | ### 1.0.9
52 | * 切换主题支持
53 | * 问题修复
54 |
55 | ### 1.0.8
56 | * readme图片解析优化
57 | * readme图片增加点击查看
58 | * 组织账号不显示活跃记录Item
59 | * 增加用户组织显示
60 |
61 |
62 |
63 | ### 1.0.7
64 | * 增加图片预览
65 | * 修复未读的通知打开提示其他异常
66 | * 增加fork仓库跳转到原仓库
67 | * 增加仓库点击展示 issue 状态信息
68 | * 增加个人状态信息可跳转
69 | * 增加仓库Topic显示
70 | * 通知中心增加侧滑点击已读
71 |
72 | ### 1.0.6
73 | * trend修改为redux
74 | * 增加本地阅读历史
75 | * drawer 状态栏样式处理
76 | * 增加个人动态提交表。
77 |
78 | ### 1.0.5
79 | * 增加本地数据库
80 | * 修复分享问题。
81 | * 修改用户页面样式
82 | * 增加用户加入github时间显示
83 |
84 | ### 1.0.4
85 |
86 | * 修复启动页变形问题。
87 | * 调整个人页面字体动态大小。
88 | * 增加趋势语言,搜索语言dart选项。
89 | * 增加前后台切换刷新动态。
90 | * 增加触摸隐藏键盘。
91 | * 增加点击检测版本。
92 | * 增加 issue 使用markdown解析
93 | * 增加 issue 输入框的快速输入按键。
94 | * 增加 issue 关闭操作信息。
95 | * 返回文件列表的返回键处理逻辑。
96 | * 修复详情中存在的model转化问题。
97 |
98 |
99 | ### 1.0.1 (已发布)
100 |
101 | * 修复loading弹出框黄线问题。
102 | * 调整部分ui。
103 | * 增加Release列表。
104 | * 增加版检测。
105 | * Issue详情页显示问题。
106 | * 返回按键退出问题。
107 |
108 |
109 |
110 | ### 1.0.0
111 |
112 | * 第一版完成
--------------------------------------------------------------------------------
/analysis_options.yaml:
--------------------------------------------------------------------------------
1 | include: package:flutter_lints/flutter.yaml
2 |
3 | analyzer:
4 | errors:
5 | mixin_inherits_from_not_object: ignore
6 | plugins:
7 | - custom_lint
8 |
9 | linter:
10 | rules:
11 | non_constant_identifier_names: false
12 | file_names: false
13 | constant_identifier_names: false
14 | library_private_types_in_public_api: false
15 | library_prefixes: false
--------------------------------------------------------------------------------
/android/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | *.class
3 | .gradle
4 | /local.properties
5 | /.idea/workspace.xml
6 | /.idea/libraries
7 | .DS_Store
8 | /build
9 | /captures
10 | GeneratedPluginRegistrant.java
11 | .cxx/
12 |
--------------------------------------------------------------------------------
/android/app/src/main/kotlin/com/shuyu/gsygithub/gsygithubappflutter/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.shuyu.gsygithub.gsygithubappflutter
2 |
3 | import UpdateAlbumPlugin
4 | import androidx.annotation.NonNull;
5 | import io.flutter.embedding.android.FlutterActivity
6 | import io.flutter.embedding.engine.FlutterEngine
7 | import io.flutter.plugins.GeneratedPluginRegistrant
8 |
9 | class MainActivity: FlutterActivity() {
10 | override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
11 | GeneratedPluginRegistrant.registerWith(flutterEngine)
12 | flutterEngine.plugins.add(UpdateAlbumPlugin())
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/android/app/src/main/kotlin/com/shuyu/gsygithub/gsygithubappflutter/UpdateAlbumPlugin.kt:
--------------------------------------------------------------------------------
1 | import android.content.Context
2 | import android.content.Intent
3 | import android.net.Uri
4 | import android.provider.MediaStore
5 | import io.flutter.embedding.engine.plugins.FlutterPlugin
6 | import io.flutter.plugin.common.MethodCall
7 | import io.flutter.plugin.common.MethodChannel
8 |
9 | class UpdateAlbumPlugin : FlutterPlugin, MethodChannel.MethodCallHandler {
10 |
11 | /** Channel名称 **/
12 |
13 | private var channel: MethodChannel? = null
14 | private var context: Context? = null
15 |
16 | companion object {
17 |
18 | private val sChannelName = "com.shuyu.gsygithub.gsygithubflutter/UpdateAlbumPlugin"
19 | }
20 |
21 | override fun onAttachedToEngine(binding: FlutterPlugin.FlutterPluginBinding) {
22 | channel = MethodChannel(
23 | binding.binaryMessenger, sChannelName)
24 | context = binding.applicationContext
25 | channel!!.setMethodCallHandler(this)
26 | }
27 |
28 | override fun onDetachedFromEngine(binding: FlutterPlugin.FlutterPluginBinding) {
29 | channel?.setMethodCallHandler(null)
30 | channel = null
31 | }
32 |
33 | override fun onMethodCall(methodCall: MethodCall, result: MethodChannel.Result) {
34 | when (methodCall.method) {
35 | "updateAlbum" -> {
36 | val path: String? = methodCall.argument("path")
37 | val name: String? = methodCall.argument("name")
38 | try {
39 | MediaStore.Images.Media.insertImage(context?.contentResolver, path, name, null)
40 | } catch (e: Exception) {
41 | e.printStackTrace()
42 | }
43 | // 最后通知图库更新
44 | context?.sendBroadcast(Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, Uri.parse("file://$path")))
45 | }
46 | }
47 | result.success(null)
48 | }
49 | }
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | -
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable/normal_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CarGuo/gsy_github_app_flutter/263497b5f78a63d8e775b229528b35ced177e1b8/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-hdpi/launch_image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CarGuo/gsy_github_app_flutter/263497b5f78a63d8e775b229528b35ced177e1b8/android/app/src/main/res/mipmap-hdpi/launch_image.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CarGuo/gsy_github_app_flutter/263497b5f78a63d8e775b229528b35ced177e1b8/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-mdpi/launch_image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CarGuo/gsy_github_app_flutter/263497b5f78a63d8e775b229528b35ced177e1b8/android/app/src/main/res/mipmap-mdpi/launch_image.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CarGuo/gsy_github_app_flutter/263497b5f78a63d8e775b229528b35ced177e1b8/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/launch_image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CarGuo/gsy_github_app_flutter/263497b5f78a63d8e775b229528b35ced177e1b8/android/app/src/main/res/mipmap-xhdpi/launch_image.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CarGuo/gsy_github_app_flutter/263497b5f78a63d8e775b229528b35ced177e1b8/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/launch_image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CarGuo/gsy_github_app_flutter/263497b5f78a63d8e775b229528b35ced177e1b8/android/app/src/main/res/mipmap-xxhdpi/launch_image.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CarGuo/gsy_github_app_flutter/263497b5f78a63d8e775b229528b35ced177e1b8/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxxhdpi/launch_image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CarGuo/gsy_github_app_flutter/263497b5f78a63d8e775b229528b35ced177e1b8/android/app/src/main/res/mipmap-xxxhdpi/launch_image.png
--------------------------------------------------------------------------------
/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
12 |
15 |
16 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | allprojects {
2 | repositories {
3 | google()
4 | }
5 | }
6 |
7 | rootProject.buildDir = '../build'
8 | subprojects {
9 | project.buildDir = "${rootProject.buildDir}/${project.name}"
10 | }
11 | subprojects {
12 | project.evaluationDependsOn(':app')
13 | }
14 |
15 | tasks.register("clean", Delete) {
16 | delete rootProject.buildDir
17 | }
18 |
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M -Dfile.encoding=UTF-8
2 | android.enableR8=true
3 | android.useAndroidX=true
4 | android.enableJetifier=true
5 | #systemProp.http.proxyHost=127.0.0.1
6 | #systemProp.http.proxyPort=7890
7 | #systemProp.https.proxyHost=127.0.0.1
8 | #systemProp.https.proxyPort=7890
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CarGuo/gsy_github_app_flutter/263497b5f78a63d8e775b229528b35ced177e1b8/android/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 |
--------------------------------------------------------------------------------
/android/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/android/gsygithubapp-debug.jks:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CarGuo/gsy_github_app_flutter/263497b5f78a63d8e775b229528b35ced177e1b8/android/gsygithubapp-debug.jks
--------------------------------------------------------------------------------
/android/settings.gradle:
--------------------------------------------------------------------------------
1 | pluginManagement {
2 | def flutterSdkPath = {
3 | def properties = new Properties()
4 | file("local.properties").withInputStream { properties.load(it) }
5 | def flutterSdkPath = properties.getProperty("flutter.sdk")
6 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
7 | return flutterSdkPath
8 | }()
9 |
10 | includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
11 |
12 | repositories {
13 | google()
14 | mavenCentral()
15 | gradlePluginPortal()
16 | }
17 | }
18 |
19 | plugins {
20 | id "dev.flutter.flutter-plugin-loader" version "1.0.0"
21 | id "com.android.application" version "8.6.1" apply false
22 | id "org.jetbrains.kotlin.android" version "1.8.10" apply false
23 | }
24 |
25 | include ":app"
--------------------------------------------------------------------------------
/devtools_options.yaml:
--------------------------------------------------------------------------------
1 | description: This file stores settings for Dart & Flutter DevTools.
2 | documentation: https://docs.flutter.dev/tools/devtools/extensions#configure-extension-enablement-states
3 | extensions:
4 |
--------------------------------------------------------------------------------
/download.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CarGuo/gsy_github_app_flutter/263497b5f78a63d8e775b229528b35ced177e1b8/download.png
--------------------------------------------------------------------------------
/folder.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CarGuo/gsy_github_app_flutter/263497b5f78a63d8e775b229528b35ced177e1b8/folder.png
--------------------------------------------------------------------------------
/framework2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CarGuo/gsy_github_app_flutter/263497b5f78a63d8e775b229528b35ced177e1b8/framework2.png
--------------------------------------------------------------------------------
/googleplay.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CarGuo/gsy_github_app_flutter/263497b5f78a63d8e775b229528b35ced177e1b8/googleplay.png
--------------------------------------------------------------------------------
/ios.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CarGuo/gsy_github_app_flutter/263497b5f78a63d8e775b229528b35ced177e1b8/ios.gif
--------------------------------------------------------------------------------
/ios/.gitignore:
--------------------------------------------------------------------------------
1 | .idea/
2 | .vagrant/
3 | .sconsign.dblite
4 | .svn/
5 |
6 | .DS_Store
7 | *.swp
8 | profile
9 |
10 | DerivedData/
11 | build/
12 | GeneratedPluginRegistrant.h
13 | GeneratedPluginRegistrant.m
14 |
15 | .generated/
16 |
17 | *.pbxuser
18 | *.mode1v3
19 | *.mode2v3
20 | *.perspectivev3
21 |
22 | !default.pbxuser
23 | !default.mode1v3
24 | !default.mode2v3
25 | !default.perspectivev3
26 |
27 | xcuserdata
28 |
29 | *.moved-aside
30 |
31 | *.pyc
32 | *sync/
33 | Icon?
34 | .tags*
35 |
36 | /Flutter/app.flx
37 | /Flutter/app.zip
38 | /Flutter/flutter_assets/
39 | /Flutter/App.framework
40 | /Flutter/Flutter.framework
41 | /Flutter/Generated.xcconfig
42 | /Flutter/Flutter.podspec
43 | /ServiceDefinitions.json
44 |
45 | Pods/
46 | .symlinks/
47 |
--------------------------------------------------------------------------------
/ios/Flutter/AppFrameworkInfo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
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 | 12.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, '12.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/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.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/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 | import Flutter
3 |
4 | @main
5 | @objc class AppDelegate: FlutterAppDelegate {
6 | override func application(
7 | _ application: UIApplication,
8 | didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?
9 | ) -> Bool {
10 | GeneratedPluginRegistrant.register(with: self)
11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions)
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/120.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CarGuo/gsy_github_app_flutter/263497b5f78a63d8e775b229528b35ced177e1b8/ios/Runner/Assets.xcassets/AppIcon.appiconset/120.jpg
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/152.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CarGuo/gsy_github_app_flutter/263497b5f78a63d8e775b229528b35ced177e1b8/ios/Runner/Assets.xcassets/AppIcon.appiconset/152.jpg
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/167.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CarGuo/gsy_github_app_flutter/263497b5f78a63d8e775b229528b35ced177e1b8/ios/Runner/Assets.xcassets/AppIcon.appiconset/167.jpg
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/180.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CarGuo/gsy_github_app_flutter/263497b5f78a63d8e775b229528b35ced177e1b8/ios/Runner/Assets.xcassets/AppIcon.appiconset/180.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CarGuo/gsy_github_app_flutter/263497b5f78a63d8e775b229528b35ced177e1b8/ios/Runner/Assets.xcassets/AppIcon.appiconset/40.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/58.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CarGuo/gsy_github_app_flutter/263497b5f78a63d8e775b229528b35ced177e1b8/ios/Runner/Assets.xcassets/AppIcon.appiconset/58.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/60.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CarGuo/gsy_github_app_flutter/263497b5f78a63d8e775b229528b35ced177e1b8/ios/Runner/Assets.xcassets/AppIcon.appiconset/60.jpg
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CarGuo/gsy_github_app_flutter/263497b5f78a63d8e775b229528b35ced177e1b8/ios/Runner/Assets.xcassets/AppIcon.appiconset/76.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/80.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CarGuo/gsy_github_app_flutter/263497b5f78a63d8e775b229528b35ced177e1b8/ios/Runner/Assets.xcassets/AppIcon.appiconset/80.jpg
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/87.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CarGuo/gsy_github_app_flutter/263497b5f78a63d8e775b229528b35ced177e1b8/ios/Runner/Assets.xcassets/AppIcon.appiconset/87.jpg
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "20x20",
5 | "idiom" : "iphone",
6 | "filename" : "40.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "20x20",
11 | "idiom" : "iphone",
12 | "filename" : "60.jpg",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "58.png",
19 | "scale" : "2x"
20 | },
21 | {
22 | "size" : "29x29",
23 | "idiom" : "iphone",
24 | "filename" : "87.jpg",
25 | "scale" : "3x"
26 | },
27 | {
28 | "size" : "40x40",
29 | "idiom" : "iphone",
30 | "filename" : "80.jpg",
31 | "scale" : "2x"
32 | },
33 | {
34 | "size" : "40x40",
35 | "idiom" : "iphone",
36 | "filename" : "logo-4.png",
37 | "scale" : "3x"
38 | },
39 | {
40 | "size" : "60x60",
41 | "idiom" : "iphone",
42 | "filename" : "120.jpg",
43 | "scale" : "2x"
44 | },
45 | {
46 | "size" : "60x60",
47 | "idiom" : "iphone",
48 | "filename" : "180.png",
49 | "scale" : "3x"
50 | },
51 | {
52 | "size" : "1024x1024",
53 | "idiom" : "ios-marketing",
54 | "filename" : "logo2x-3.jpg",
55 | "scale" : "1x"
56 | },
57 | {
58 | "size" : "152x152",
59 | "idiom" : "iphone",
60 | "filename" : "152.jpg",
61 | "scale" : "1x"
62 | },
63 | {
64 | "size" : "167x167",
65 | "idiom" : "iphone",
66 | "filename" : "167.jpg",
67 | "scale" : "1x"
68 | },
69 | {
70 | "size" : "76x76",
71 | "idiom" : "iphone",
72 | "filename" : "76.png",
73 | "scale" : "1x"
74 | }
75 | ],
76 | "info" : {
77 | "version" : 1,
78 | "author" : "xcode"
79 | }
80 | }
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/logo-4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CarGuo/gsy_github_app_flutter/263497b5f78a63d8e775b229528b35ced177e1b8/ios/Runner/Assets.xcassets/AppIcon.appiconset/logo-4.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/logo2x-3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CarGuo/gsy_github_app_flutter/263497b5f78a63d8e775b229528b35ced177e1b8/ios/Runner/Assets.xcassets/AppIcon.appiconset/logo2x-3.jpg
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "iphone",
9 | "filename" : "Default@3x-1.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "iphone",
14 | "filename" : "Default@3x.png",
15 | "scale" : "3x"
16 | },
17 | {
18 | "idiom" : "iphone",
19 | "subtype" : "retina4",
20 | "scale" : "1x"
21 | },
22 | {
23 | "idiom" : "iphone",
24 | "filename" : "Default@3x-2.png",
25 | "subtype" : "retina4",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "filename" : "Default@3x-4.png",
31 | "subtype" : "retina4",
32 | "scale" : "3x"
33 | },
34 | {
35 | "idiom" : "iphone",
36 | "subtype" : "736h",
37 | "scale" : "3x"
38 | },
39 | {
40 | "idiom" : "iphone",
41 | "filename" : "Default@2x.png",
42 | "subtype" : "667h",
43 | "scale" : "2x"
44 | },
45 | {
46 | "idiom" : "iphone",
47 | "filename" : "Default@3x-3.png",
48 | "subtype" : "2436h",
49 | "scale" : "3x"
50 | }
51 | ],
52 | "info" : {
53 | "version" : 1,
54 | "author" : "xcode"
55 | }
56 | }
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/Default@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CarGuo/gsy_github_app_flutter/263497b5f78a63d8e775b229528b35ced177e1b8/ios/Runner/Assets.xcassets/LaunchImage.imageset/Default@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/Default@3x-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CarGuo/gsy_github_app_flutter/263497b5f78a63d8e775b229528b35ced177e1b8/ios/Runner/Assets.xcassets/LaunchImage.imageset/Default@3x-1.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/Default@3x-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CarGuo/gsy_github_app_flutter/263497b5f78a63d8e775b229528b35ced177e1b8/ios/Runner/Assets.xcassets/LaunchImage.imageset/Default@3x-2.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/Default@3x-3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CarGuo/gsy_github_app_flutter/263497b5f78a63d8e775b229528b35ced177e1b8/ios/Runner/Assets.xcassets/LaunchImage.imageset/Default@3x-3.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/Default@3x-4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CarGuo/gsy_github_app_flutter/263497b5f78a63d8e775b229528b35ced177e1b8/ios/Runner/Assets.xcassets/LaunchImage.imageset/Default@3x-4.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/Default@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CarGuo/gsy_github_app_flutter/263497b5f78a63d8e775b229528b35ced177e1b8/ios/Runner/Assets.xcassets/LaunchImage.imageset/Default@3x.png
--------------------------------------------------------------------------------
/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/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
2 |
--------------------------------------------------------------------------------
/ios_wait.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CarGuo/gsy_github_app_flutter/263497b5f78a63d8e775b229528b35ced177e1b8/ios_wait.png
--------------------------------------------------------------------------------
/l10n.yaml:
--------------------------------------------------------------------------------
1 | arb-dir: lib/common/localization/l10n
2 | template-arb-file: app_en.arb
3 | output-localization-file: app_localizations.dart
4 | synthetic-package: false
--------------------------------------------------------------------------------
/lib/common/config/config.dart:
--------------------------------------------------------------------------------
1 | class Config {
2 | static bool? DEBUG = true;
3 |
4 |
5 |
6 | static const PAGE_SIZE = 20;
7 |
8 | /// //////////////////////////////////////常量////////////////////////////////////// ///
9 | static const API_TOKEN = "4d65e2a5626103f92a71867d7b49fea0";
10 | static const TOKEN_KEY = "token";
11 | static const USER_NAME_KEY = "user-name";
12 | static const PW_KEY = "user-pw";
13 | static const USER_BASIC_CODE = "user-basic-code";
14 | static const USER_INFO = "user-info";
15 | static const LANGUAGE_SELECT = "language-select";
16 | static const LANGUAGE_SELECT_NAME = "language-select-name";
17 | static const REFRESH_LANGUAGE = "refreshLanguageApp";
18 | static const THEME_COLOR = "theme-color";
19 | static const LOCALE = "locale";
20 | }
21 |
--------------------------------------------------------------------------------
/lib/common/event/event_bus.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 |
3 | /// Dispatches events to listeners using the Dart [Stream] API. The [EventBus]
4 | /// enables decoupled applications. It allows objects to interact without
5 | /// requiring to explicitly define listeners and keeping track of them.
6 | ///
7 | /// Not all events should be broadcasted through the [EventBus] but only those of
8 | /// general interest.
9 | ///
10 | /// Events are normal Dart objects. By specifying a class, listeners can
11 | /// filter events.
12 | ///
13 | class EventBus {
14 | final StreamController _streamController;
15 |
16 | /// Controller for the event bus stream.
17 | StreamController get streamController => _streamController;
18 |
19 | /// Creates an [EventBus].
20 | ///
21 | /// If [sync] is true, events are passed directly to the stream's listeners
22 | /// during a [fire] call. If false (the default), the event will be passed to
23 | /// the listeners at a later time, after the code creating the event has
24 | /// completed.
25 | EventBus({bool sync = false})
26 | : _streamController = StreamController.broadcast(sync: sync);
27 |
28 | /// Instead of using the default [StreamController] you can use this constructor
29 | /// to pass your own controller.
30 | ///
31 | /// An example would be to use an RxDart Subject as the controller.
32 | EventBus.customController(StreamController controller)
33 | : _streamController = controller;
34 |
35 | /// Listens for events of Type [T] and its subtypes.
36 | ///
37 | /// The method is called like this: myEventBus.on();
38 | ///
39 | /// If the method is called without a type parameter, the [Stream] contains every
40 | /// event of this [EventBus].
41 | ///
42 | /// The returned [Stream] is a broadcast stream so multiple subscriptions are
43 | /// allowed.
44 | ///
45 | /// Each listener is handled independently, and if they pause, only the pausing
46 | /// listener is affected. A paused listener will buffer events internally until
47 | /// unpaused or canceled. So it's usually better to just cancel and later
48 | /// subscribe again (avoids memory leak).
49 | ///
50 | Stream on() {
51 | if (T == dynamic) {
52 | return streamController.stream as Stream ;
53 | } else {
54 | return streamController.stream.where((event) => event is T).cast();
55 | }
56 | }
57 |
58 | /// Fires a new event on the event bus with the specified [event].
59 | ///
60 | void fire(event) {
61 | streamController.add(event);
62 | }
63 |
64 | /// Destroy this [EventBus]. This is generally only in a testing context.
65 | ///
66 | void destroy() {
67 | _streamController.close();
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/lib/common/event/http_error_event.dart:
--------------------------------------------------------------------------------
1 | /// Created by guoshuyu
2 | /// Date: 2018-08-16
3 | library;
4 |
5 | class HttpErrorEvent {
6 | final int? code;
7 |
8 | final String message;
9 |
10 | HttpErrorEvent(this.code, this.message);
11 | }
12 |
--------------------------------------------------------------------------------
/lib/common/event/index.dart:
--------------------------------------------------------------------------------
1 | import 'event_bus.dart';
2 |
3 | EventBus eventBus = EventBus();
--------------------------------------------------------------------------------
/lib/common/local/local_storage.dart:
--------------------------------------------------------------------------------
1 | import 'package:shared_preferences/shared_preferences.dart';
2 |
3 | ///SharedPreferences 本地存储
4 | class LocalStorage {
5 |
6 | static save(String key, value) async {
7 | SharedPreferences prefs = await SharedPreferences.getInstance();
8 | prefs.setString(key, value);
9 | }
10 |
11 | static get(String key) async {
12 | SharedPreferences prefs = await SharedPreferences.getInstance();
13 | return prefs.get(key);
14 | }
15 |
16 | static remove(String key) async {
17 | SharedPreferences prefs = await SharedPreferences.getInstance();
18 | prefs.remove(key);
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/lib/common/localization/extension.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:gsy_github_app_flutter/common/localization/l10n/app_localizations.dart';
3 |
4 |
5 |
6 |
7 | extension LocalizationExtension on BuildContext {
8 | AppLocalizations get l10n => AppLocalizations.of(this)!;
9 | }
--------------------------------------------------------------------------------
/lib/common/logger.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/foundation.dart';
2 | import 'package:talker_flutter/talker_flutter.dart';
3 |
4 | final talker = TalkerFlutter.init(
5 | settings: TalkerSettings(
6 | /// You can enable/disable all talker processes with this field
7 | enabled: true,
8 |
9 | /// You can enable/disable saving logs data in history
10 | useHistory: true,
11 |
12 | /// Length of history that saving logs data
13 | maxHistoryItems: 100,
14 |
15 | /// You can enable/disable console logs
16 | useConsoleLogs: true,
17 | ),
18 | );
19 |
20 | printLog(Object msg) {
21 | if (msg is Error) {
22 | talker.error("Catch Running Error:", msg);
23 | } else if (msg is Exception) {
24 | talker.error("Catch Running Exception:", msg);
25 | }
26 | if (kDebugMode) {
27 | print(msg);
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/lib/common/net/code.dart:
--------------------------------------------------------------------------------
1 | import 'package:gsy_github_app_flutter/common/event/http_error_event.dart';
2 | import 'package:gsy_github_app_flutter/common/event/index.dart';
3 |
4 | ///错误编码
5 | class Code {
6 | ///网络错误
7 | static const NETWORK_ERROR = -1;
8 |
9 | ///网络超时
10 | static const NETWORK_TIMEOUT = -2;
11 |
12 | ///网络返回数据格式化一次
13 | static const NETWORK_JSON_EXCEPTION = -3;
14 |
15 | ///Github APi Connection refused
16 | static const GITHUB_API_REFUSED = -4;
17 |
18 | static const SUCCESS = 200;
19 |
20 | static errorHandleFunction(code, message, noTip) {
21 | if (noTip) {
22 | return message;
23 | }
24 | if(message != null && message is String && (message.contains("Connection refused") || message.contains("Connection reset"))) {
25 | code = GITHUB_API_REFUSED;
26 | }
27 | eventBus.fire(HttpErrorEvent(code, message));
28 | return message;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/lib/common/net/graphql/client.dart:
--------------------------------------------------------------------------------
1 | import 'package:graphql/client.dart';
2 | import 'package:gsy_github_app_flutter/common/net/graphql/repositories.dart';
3 | import 'package:gsy_github_app_flutter/common/net/graphql/users.dart';
4 | import 'package:gsy_github_app_flutter/common/utils/common_utils.dart';
5 |
6 | Future _client(token) async {
7 | final HttpLink httpLink = HttpLink(
8 | 'https://api.github.com/graphql',
9 | );
10 |
11 | final AuthLink authLink = AuthLink(
12 | getToken: () => '$token',
13 | );
14 |
15 | final Link link = authLink.concat(httpLink);
16 | var path = await CommonUtils.getApplicationDocumentsPath();
17 | final store = await HiveStore.open(path: path);
18 | return GraphQLClient(
19 | cache: GraphQLCache(store: store),
20 | link: link,
21 | );
22 | }
23 |
24 | GraphQLClient? _innerClient;
25 |
26 | initClient(token) async {
27 | _innerClient ??= await _client(token);
28 | }
29 |
30 | releaseClient() {
31 | _innerClient = null;
32 | }
33 |
34 | Future? getRepository(String owner, String? name) async {
35 | final QueryOptions options = QueryOptions(
36 | document: gql(readRepository),
37 | variables: {
38 | 'owner': owner,
39 | 'name': name,
40 | },
41 | fetchPolicy: FetchPolicy.noCache);
42 | return await _innerClient!.query(options);
43 | }
44 |
45 | Future? getTrendUser(String location, {String? cursor}) async {
46 | var variables = cursor == null
47 | ? {
48 | 'location': "location:$location sort:followers",
49 | }
50 | : {
51 | 'location': "location:$location sort:followers",
52 | 'after': cursor,
53 | };
54 | final QueryOptions options = QueryOptions(
55 | document: gql(cursor == null ? readTrendUser : readTrendUserByCursor),
56 | variables: variables,
57 | fetchPolicy: FetchPolicy.noCache);
58 | return await _innerClient!.query(options);
59 | }
60 |
--------------------------------------------------------------------------------
/lib/common/net/graphql/repositories.dart:
--------------------------------------------------------------------------------
1 | const String readRepository = r'''
2 | query getRepositoryDetail($owner:String!, $name:String!){
3 | repository(name: $name, owner: $owner) {
4 | ...comparisonFields
5 | parent {
6 | ...comparisonFields
7 | }
8 | }
9 | }
10 |
11 | fragment comparisonFields on Repository {
12 | issuesClosed: issues(states : CLOSED) {
13 | totalCount
14 | }
15 | issuesOpen: issues(states : OPEN) {
16 | totalCount
17 | }
18 | issues {
19 | totalCount
20 | }
21 | nameWithOwner,
22 | id,
23 | name,
24 | owner {
25 | login,
26 | url,
27 | avatarUrl,
28 | },
29 | licenseInfo {
30 | name
31 | }
32 | forkCount,
33 | stargazers{
34 | totalCount
35 | }
36 | hasIssuesEnabled,
37 | viewerHasStarred,
38 | viewerSubscription,
39 | hasIssuesEnabled,
40 | defaultBranchRef {
41 | name
42 | },
43 | watchers {
44 | totalCount,
45 | }
46 | isFork
47 | languages(first:100) {
48 | totalSize,
49 | nodes {
50 | name,
51 | }
52 | },
53 | createdAt,
54 | pushedAt,
55 | pushedAt,
56 | sshUrl,
57 | url,
58 | shortDescriptionHTML,
59 | repositoryTopics(first: 100) {
60 | totalCount,
61 | nodes {
62 | topic {
63 | name,
64 | }
65 | }
66 | }
67 | }
68 | ''';
69 |
--------------------------------------------------------------------------------
/lib/common/net/graphql/users.dart:
--------------------------------------------------------------------------------
1 | const String readTrendUser = r'''
2 | query getTrendUser($location: String!){
3 | search(type: USER, query: $location, first: 100) {
4 | pageInfo {
5 | endCursor
6 | }
7 | user: edges {
8 | user: node {
9 | ... on User {
10 | name,
11 | avatarUrl,
12 | followers {
13 | totalCount
14 | },
15 | bio,
16 | login,
17 | lang: repositories(orderBy: {field: STARGAZERS, direction: DESC}, first:1) {
18 | nodes{
19 | name
20 | languages(first:1) {
21 | nodes {
22 | name
23 | }
24 | }
25 | }
26 | }
27 | }
28 | }
29 | }
30 | }
31 | }
32 | ''';
33 |
34 |
35 | const String readTrendUserByCursor = r'''
36 | query getTrendUser($location: String!, $after: String!){
37 | search(type: USER, query: $location, first: 100, after: $after) {
38 | pageInfo {
39 | endCursor
40 | }
41 | user: edges {
42 | user: node {
43 | ... on User {
44 | name,
45 | avatarUrl,
46 | followers {
47 | totalCount
48 | },
49 | bio,
50 | login,
51 | lang: repositories(orderBy: {field: STARGAZERS, direction: DESC}, first:1) {
52 | nodes{
53 | name
54 | languages(first:1) {
55 | nodes {
56 | name
57 | }
58 | }
59 | }
60 | }
61 | }
62 | }
63 | }
64 | }
65 | }
66 | ''';
67 |
--------------------------------------------------------------------------------
/lib/common/net/interceptors/error_interceptor.dart:
--------------------------------------------------------------------------------
1 | import 'package:connectivity_plus/connectivity_plus.dart';
2 | import 'package:dio/dio.dart';
3 | import 'package:gsy_github_app_flutter/common/net/code.dart';
4 | import 'package:gsy_github_app_flutter/common/net/result_data.dart';
5 |
6 | ///是否需要弹提示
7 | const NOT_TIP_KEY = "noTip";
8 |
9 | /// 错误拦截
10 | /// Created by guoshuyu
11 | /// on 2019/3/23.
12 | class ErrorInterceptors extends InterceptorsWrapper {
13 | @override
14 | onRequest(RequestOptions options, handler) async {
15 | //没有网络
16 | var connectivityResult = await (Connectivity().checkConnectivity());
17 | if (connectivityResult.isEmpty ||
18 | connectivityResult[0] == ConnectivityResult.none) {
19 | return handler.reject(DioException(
20 | requestOptions: options,
21 | type: DioExceptionType.unknown,
22 | response: Response(
23 | requestOptions: options,
24 | data: ResultData(
25 | Code.errorHandleFunction(Code.NETWORK_ERROR, "", false),
26 | false,
27 | Code.NETWORK_ERROR))));
28 | }
29 | return super.onRequest(options, handler);
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/lib/common/net/interceptors/header_interceptor.dart:
--------------------------------------------------------------------------------
1 | import 'package:dio/dio.dart';
2 |
3 | /// header拦截器
4 | /// Created by guoshuyu
5 | /// on 2019/3/23.
6 | class HeaderInterceptors extends InterceptorsWrapper {
7 | @override
8 | onRequest(RequestOptions options, handler) async {
9 | ///超时
10 | options.connectTimeout = const Duration(seconds: 30);
11 | options.receiveTimeout = const Duration(seconds: 30);
12 |
13 | return super.onRequest(options, handler);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/lib/common/net/interceptors/response_interceptor.dart:
--------------------------------------------------------------------------------
1 | import 'package:dio/dio.dart';
2 | import 'package:gsy_github_app_flutter/common/logger.dart';
3 | import 'package:gsy_github_app_flutter/common/net/code.dart';
4 | import 'package:gsy_github_app_flutter/common/net/result_data.dart';
5 |
6 | /// Token拦截器
7 | /// Created by guoshuyu
8 | /// on 2019/3/23.
9 | class ResponseInterceptors extends InterceptorsWrapper {
10 | @override
11 | onResponse(Response response, handler) async {
12 | RequestOptions option = response.requestOptions;
13 | dynamic value;
14 | try {
15 | var header = response.headers[Headers.contentTypeHeader];
16 | if ((header != null && header.toString().contains("text"))) {
17 | value = ResultData(response.data, true, Code.SUCCESS);
18 | } else if (response.statusCode! >= 200 && response.statusCode! < 300) {
19 | value = ResultData(response.data, true, Code.SUCCESS,
20 | headers: response.headers);
21 | }
22 | } catch (e) {
23 | printLog(e.toString() + option.path);
24 | value = ResultData(response.data, false, response.statusCode,
25 | headers: response.headers);
26 | }
27 | response.data = value;
28 | return handler.next(response);
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/lib/common/net/interceptors/token_interceptor.dart:
--------------------------------------------------------------------------------
1 | import 'package:dio/dio.dart';
2 | import 'package:gsy_github_app_flutter/common/config/config.dart';
3 | import 'package:gsy_github_app_flutter/common/local/local_storage.dart';
4 | import 'package:gsy_github_app_flutter/common/logger.dart';
5 | import 'package:gsy_github_app_flutter/common/net/graphql/client.dart';
6 |
7 | /// Token拦截器
8 | /// Created by guoshuyu
9 | /// on 2019/3/23.
10 | class TokenInterceptors extends InterceptorsWrapper {
11 | String? _token;
12 |
13 | @override
14 | onRequest(RequestOptions options, handler) async {
15 | //授权码
16 | if (_token == null) {
17 | var authorizationCode = await getAuthorization();
18 | if (authorizationCode != null) {
19 | _token = authorizationCode;
20 | await initClient(_token);
21 | }
22 | }
23 | if(_token != null) {
24 | options.headers["Authorization"] = _token;
25 | }
26 | return super.onRequest(options, handler);
27 | }
28 |
29 | @override
30 | onResponse(Response response, handler) async {
31 | try {
32 | var responseJson = response.data;
33 | if (response.statusCode == 201 && responseJson["token"] != null) {
34 | _token = 'token ${responseJson["token"]}';
35 | await LocalStorage.save(Config.TOKEN_KEY, _token);
36 | }
37 | } catch (e) {
38 | printLog(e);
39 | }
40 | return super.onResponse(response, handler);
41 | }
42 |
43 | ///清除授权
44 | clearAuthorization() {
45 | _token = null;
46 | LocalStorage.remove(Config.TOKEN_KEY);
47 | releaseClient();
48 | }
49 |
50 | ///获取授权token
51 | getAuthorization() async {
52 | String? token = await LocalStorage.get(Config.TOKEN_KEY);
53 | if (token == null) {
54 | String? basic = await LocalStorage.get(Config.USER_BASIC_CODE);
55 | if (basic == null) {
56 | //提示输入账号密码
57 | } else {
58 | //通过 basic 去获取token,获取到设置,返回token
59 | return "Basic $basic";
60 | }
61 | } else {
62 | _token = token;
63 | return token;
64 | }
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/lib/common/net/result_data.dart:
--------------------------------------------------------------------------------
1 | /// 网络结果数据
2 | /// Created by guoshuyu
3 | /// Date: 2018-07-16
4 | class ResultData {
5 | dynamic data;
6 | bool result;
7 | int? code;
8 | dynamic headers;
9 |
10 | ResultData(this.data, this.result, this.code, {this.headers});
11 | }
12 |
--------------------------------------------------------------------------------
/lib/common/net/transformer.dart:
--------------------------------------------------------------------------------
1 | import 'package:built_value/iso_8601_date_time_serializer.dart';
2 | import 'package:built_value/serializer.dart';
3 | import 'package:built_value/standard_json_plugin.dart';
4 | import 'package:gsy_github_app_flutter/model/branch.dart';
5 |
6 |
7 | part 'transformer.g.dart';
8 |
9 | @SerializersFor([
10 | Branch,
11 | ])
12 | final Serializers serializers = (_$serializers.toBuilder()
13 | ..addPlugin(StandardJsonPlugin())
14 | ..add(Iso8601DateTimeSerializer())
15 | ).build();
16 |
--------------------------------------------------------------------------------
/lib/common/net/transformer.g.dart:
--------------------------------------------------------------------------------
1 | // GENERATED CODE - DO NOT MODIFY BY HAND
2 |
3 | part of 'transformer.dart';
4 |
5 | // **************************************************************************
6 | // BuiltValueGenerator
7 | // **************************************************************************
8 |
9 | Serializers _$serializers =
10 | (new Serializers().toBuilder()..add(Branch.serializer)).build();
11 |
12 | // ignore_for_file: deprecated_member_use_from_same_package,type=lint
13 |
--------------------------------------------------------------------------------
/lib/common/repositories/data_result.dart:
--------------------------------------------------------------------------------
1 | class DataResult {
2 | Object? data;
3 | bool result;
4 | Function? next;
5 |
6 | DataResult(this.data, this.result, {this.next});
7 | }
8 |
--------------------------------------------------------------------------------
/lib/common/router/anima_route.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | ///动画大小变化打开的路由
4 | class SizeRoute extends PageRouteBuilder {
5 | final Widget? widget;
6 |
7 | SizeRoute({this.widget})
8 | : super(
9 | pageBuilder: (
10 | BuildContext context,
11 | Animation animation,
12 | Animation secondaryAnimation,
13 | ) =>
14 | widget!,
15 | transitionsBuilder: (
16 | BuildContext context,
17 | Animation animation,
18 | Animation secondaryAnimation,
19 | Widget child,
20 | ) {
21 | var begin = 0.0;
22 | var end = 1.0;
23 | var curve = Curves.ease;
24 |
25 | var tween = Tween(begin: begin, end: end).chain(CurveTween(curve: curve));
26 |
27 | return Align(
28 | child: SizeTransition(
29 | sizeFactor: animation.drive(tween),
30 | child: child,
31 | ),
32 | );
33 | },
34 | );
35 | }
36 |
37 | class NoAnimationRoute extends PageRouteBuilder {
38 | final Widget? widget;
39 |
40 | NoAnimationRoute({this.widget})
41 | : super(
42 | pageBuilder: (
43 | BuildContext context,
44 | Animation animation,
45 | Animation secondaryAnimation,
46 | ) =>
47 | widget!,
48 | transitionsBuilder: (
49 | BuildContext context,
50 | Animation animation,
51 | Animation secondaryAnimation,
52 | Widget child,
53 | ) =>
54 | SlideTransition(
55 | position: Tween(
56 | begin: const Offset(0.0, 0.0),
57 | end: const Offset(0.0, 0.0),
58 | ).animate(animation),
59 | child: child,
60 | ),
61 | );
62 | }
63 |
--------------------------------------------------------------------------------
/lib/common/toast.dart:
--------------------------------------------------------------------------------
1 |
2 | import 'package:fluttertoast/fluttertoast.dart';
3 |
4 | showToast(String message) {
5 | Fluttertoast.showToast(
6 | msg: message,
7 | gravity: ToastGravity.CENTER,
8 | toastLength: Toast.LENGTH_LONG);
9 | }
--------------------------------------------------------------------------------
/lib/common/utils/code_utils.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 |
3 | ///isolate 的 compute 需要静态方法
4 | class CodeUtils {
5 | static List decodeListResult(String? data) {
6 | return json.decode(data!);
7 | }
8 |
9 | static Map decodeMapResult(String? data) {
10 | return json.decode(data!);
11 | }
12 |
13 | static String encodeToString(String data) {
14 | return json.encode(data);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/lib/db/provider/event/received_event_db_provider.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 | import 'package:flutter/foundation.dart';
3 | import 'package:gsy_github_app_flutter/common/utils/code_utils.dart';
4 | import 'package:gsy_github_app_flutter/db/sql_provider.dart';
5 | import 'package:gsy_github_app_flutter/model/event.dart';
6 | import 'package:sqflite/sqflite.dart';
7 |
8 | /// 用户接受事件表
9 | /// Created by guoshuyu
10 | /// Date: 2018-08-07
11 |
12 | class ReceivedEventDbProvider extends BaseDbProvider {
13 | final String name = 'ReceivedEvent';
14 |
15 | final String columnId = "_id";
16 | final String columnData = "data";
17 |
18 | int? id;
19 | String? data;
20 |
21 | ReceivedEventDbProvider();
22 |
23 | Map toMap(String eventMapString) {
24 | Map map = {columnData: eventMapString};
25 | if (id != null) {
26 | map[columnId] = id;
27 | }
28 | return map;
29 | }
30 |
31 | ReceivedEventDbProvider.fromMap(Map map) {
32 | id = map[columnId];
33 | data = map[columnData];
34 | }
35 |
36 | @override
37 | tableSqlString() {
38 | return tableBaseString(name, columnId) +
39 | '''
40 | $columnData text not null)
41 | ''';
42 | }
43 |
44 | @override
45 | tableName() {
46 | return name;
47 | }
48 |
49 | ///插入到数据库
50 | Future insert(String eventMapString) async {
51 | Database db = await getDataBase();
52 |
53 | ///清空后再插入,因为只保存第一页面
54 | db.execute("delete from $name");
55 | return await db.insert(name, toMap(eventMapString));
56 | }
57 |
58 | ///获取事件数据
59 | Future>? getEvents() async {
60 | Database db = await getDataBase();
61 | List