Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: PicGo/flutter-picgo
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.6.0+14
Choose a base ref
...
head repository: PicGo/flutter-picgo
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 3,439 additions and 1,934 deletions.
  1. +1 −1 .github/workflows/build.yml
  2. +3 −0 .gitignore
  3. +19 −9 README.md
  4. +3 −0 android/app/build.gradle
  5. BIN docs/hostconfig.jpeg
  6. +23 −0 docs/static/location.html
  7. +4 −4 docs/version.json
  8. +17 −0 docs/注意事项.md
  9. +6 −4 docs/设计文档.md
  10. +20 −61 ios/Podfile
  11. +17 −53 ios/Podfile.lock
  12. +3 −6 ios/Runner.xcodeproj/project.pbxproj
  13. +51 −0 lib/api/lsky_api.dart
  14. +74 −6 lib/api/qiniu_api.dart
  15. +19 −3 lib/api/smms_api.dart
  16. +8 −10 lib/api/tcyun_api.dart
  17. +95 −0 lib/api/upyun_api.dart
  18. +124 −0 lib/components/manage_item.dart
  19. +193 −0 lib/components/upload_item/upload_item.dart
  20. +4 −19 ...views/upload_page/upload_page_presenter.dart → components/upload_item/upload_item_presenter.dart}
  21. +0 −17 lib/components/uploaded_item.dart
  22. +0 −7 lib/event/event_bus.dart
  23. +0 −7 lib/event/event_model.dart
  24. +1 −1 lib/main.dart
  25. +5 −13 lib/model/gitee_content.dart
  26. +5 −12 lib/model/github_content.dart
  27. +24 −0 lib/model/lsky_config.dart
  28. +72 −0 lib/model/lsky_content.dart
  29. +46 −0 lib/model/qiniu_content.dart
  30. +56 −0 lib/model/smms_content.dart
  31. +36 −0 lib/model/upyun_config.dart
  32. +4 −0 lib/resources/pb_type_keys.dart
  33. +1 −1 lib/routers/application.dart
  34. +46 −6 lib/routers/router_handler.dart
  35. +17 −2 lib/routers/routers.dart
  36. +23 −9 lib/utils/db_provider.dart
  37. +42 −0 lib/utils/extended.dart
  38. +223 −0 lib/utils/image_preview.dart
  39. +14 −8 lib/utils/local_notification.dart
  40. +13 −3 lib/utils/net.dart
  41. +5 −3 lib/utils/strategy/impl/aliyun_image_upload.dart
  42. +59 −0 lib/utils/strategy/impl/lsky_image_upload.dart
  43. +2 −12 lib/utils/strategy/impl/qiniu_image_upload.dart
  44. +0 −1 lib/utils/strategy/impl/tcyun_image_upload.dart
  45. +94 −0 lib/utils/strategy/impl/upyun_image_upload.dart
  46. +8 −0 lib/utils/strategy/upload_strategy_factory.dart
  47. +97 −69 lib/views/album_page/album_page.dart
  48. +0 −2 lib/views/album_page/album_page_presenter.dart
  49. +2 −2 lib/views/home.dart
  50. +42 −0 lib/views/manage_page/base_loading_page_state.dart
  51. +186 −0 lib/views/manage_page/gitee_page/gitee_repo_page.dart
  52. +32 −0 lib/views/{pb_setting_page → manage_page}/gitee_page/gitee_repo_page_presenter.dart
  53. +186 −0 lib/views/manage_page/github_page/github_repo_page.dart
  54. +28 −0 lib/views/{pb_setting_page → manage_page}/github_page/github_repo_page_presenter.dart
  55. +194 −0 lib/views/manage_page/lsky_page/lsky_repo_page.dart
  56. +62 −0 lib/views/manage_page/lsky_page/lsky_repo_page_presenter.dart
  57. +163 −0 lib/views/manage_page/qiniu_page/qiniu_repo_page.dart
  58. +87 −0 lib/views/manage_page/qiniu_page/qiniu_repo_page_presenter.dart
  59. +226 −0 lib/views/manage_page/smms_page/smms_repo_page.dart
  60. +47 −0 lib/views/manage_page/smms_page/smms_repo_page_presenter.dart
  61. +3 −11 lib/views/pb_setting_page/aliyun_page/aliyun_page.dart
  62. +30 −8 lib/views/pb_setting_page/base_pb_page_state.dart
  63. +55 −241 lib/views/pb_setting_page/gitee_page/gitee_page.dart
  64. +0 −62 lib/views/pb_setting_page/gitee_page/gitee_page_presenter.dart
  65. +0 −168 lib/views/pb_setting_page/gitee_page/gitee_repo_page.dart
  66. +52 −227 lib/views/pb_setting_page/github_page/github_page.dart
  67. +0 −62 lib/views/pb_setting_page/github_page/github_page_presenter.dart
  68. +0 −168 lib/views/pb_setting_page/github_page/github_repo_page.dart
  69. +103 −0 lib/views/pb_setting_page/lsky_page/lsky_page.dart
  70. +3 −6 lib/views/pb_setting_page/niupic_page/niupic_page.dart
  71. +0 −2 lib/views/pb_setting_page/pb_setting_presenter.dart
  72. +16 −11 lib/views/pb_setting_page/qiniu_page/qiniu_page.dart
  73. +36 −151 lib/views/pb_setting_page/smms_page/smms_page.dart
  74. +0 −68 lib/views/pb_setting_page/smms_page/smms_page_presenter.dart
  75. +3 −6 lib/views/pb_setting_page/tcyun_page/tcyun_page.dart
  76. +67 −0 lib/views/pb_setting_page/upyun_page/upyun_page.dart
  77. +22 −5 lib/views/picgo_setting_page/picgo_setting_page.dart
  78. +7 −0 lib/views/setting_page/setting_page.dart
  79. +194 −0 lib/views/upload_page/handle_upload_page.dart
  80. +0 −348 lib/views/upload_page/upload_page.dart
  81. +10 −10 pubspec.yaml
  82. +2 −10 test/api/aliyun_api_test.dart
  83. +0 −3 test/api/qiniu_api_test.dart
  84. +4 −16 test/api/tcyun_api_test.dart
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@ jobs:
channel: 'stable' # or: 'dev' or 'beta'
- run: flutter pub get
- run: flutter test
- run: flutter build apk --release
- run: flutter build apk --release --no-tree-shake-icons
- uses: actions/upload-artifact@v2
with:
path: build/app/outputs/apk/release/*.apk
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -43,3 +43,6 @@ app.*.map.json

# Exceptions to above rules.
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages

# ios build
ios/Flutter/.last_build_id
28 changes: 19 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -4,8 +4,8 @@
<blockquote>图片上传+管理新体验 </blockquote>
<img src="https://img.shields.io/github/license/hackycy/flutter-picgo" alt="">
<img src="https://img.shields.io/github/workflow/status/hackycy/flutter-picgo/Build and Release apk" alt="">
<img src="https://img.shields.io/github/repo-size/hackycy/flutter-picgo" alt="">
<img src="https://img.shields.io/github/v/release/hackycy/flutter-picgo" alt="">
<img src="https://img.shields.io/github/issues-closed/hackycy/flutter-picgo" alt="">
<img src="https://img.shields.io/github/v/release/hackycy/flutter-picgo?include_prereleases" alt="">
<img src="https://img.shields.io/github/downloads/hackycy/flutter-picgo/total" alt="">
</div>

@@ -21,36 +21,45 @@ Flutter-PicGo: 一个用于快速上传图片并获取图片URL链接的**手机
- 七牛云 [v1.3+]
- 阿里云OSS [v1.4+]
- 腾讯云COS [v1.5+]
- ~~牛图网(已无法使用)~~ [v1.6+]
- 兰空 [v1.7+]
- 又拍云 [v1.8+]

> 开发进度可以查看 [Projects](https://github.com/PicGo/flutter-picgo/projects),会同步更新开发进度
# 特色功能

- 长按相册列表项可**同步删除远端的文件**,也可配置仅删除本地列表
- 支持扫描二维码将*PicGo(v2.3.0-beta.2以上版本)*配置文件转换成*Flutter-PicGo*的配置,使用请移步[链接](https://github.com/Molunerfinn/PicGo/releases/tag/v2.3.0-beta.2)
- 支持**管理(查看或删除)远端图床**(目前支持管理Github、Gitee、SM.MS、兰空、七牛)[v1.9+]
- 支持扫描二维码将[PicGo(v2.3.0-beta.2以上版本支持将配置导出成二维码)](https://github.com/Molunerfinn/PicGo/releases/tag/v2.3.0-beta.2)配置文件转换成**Flutter-PicGo**的配置
- 适配深色模式,可跟随系统或手动设置
- 支持将*Flutter-PicGo*的配置导出至剪切板

> 基本使用配置与PicGo无异,可参考[配置文档](https://picgo.github.io/PicGo-Doc/zh/guide/config.html#%E5%9B%BE%E5%BA%8A%E5%8C%BA)
> 腾讯云COS仅支持v5版配置
> 注:牛图与兰空不支持远端删除,腾讯云COS仅支持v5版配置
# 应用截图

![](https://github.static.si-yee.com/image_picker_82452E23-BE11-4712-BFBA-8E93038DB410-3851-00000340B21CCF62.png)
![上传页面](https://github.static.si-yee.com/image_picker_82452E23-BE11-4712-BFBA-8E93038DB410-3851-00000340B21CCF62.png)

![管理页面Gif](https://github.static.si-yee.com/picgo/repo_use.gif)

# 下载安装

| | Android | iOS |
| :----: | :----------------------------------------------------------: | :----------------------------------------------------------: |
| 二维码 | ![](https://github.static.si-yee.com/picgo/android.png) | ![](https://github.static.si-yee.com/picgo/appstore.png) |
| 链接 | [点击链接](https://github.com/hackycy/flutter-picgo/releases) | [点击链接](https://apps.apple.com/cn/app/flutter-picgo/id1519714305) |
| 链接 | [Release](https://github.com/hackycy/flutter-picgo/releases) / [蒲公英](https://www.pgyer.com/flutter-picgo) | [AppStore](https://apps.apple.com/cn/app/flutter-picgo/id1519714305) |

> 感谢[Trevor-Lan](https://github.com/Trevor-Lan)提供的苹果开发者账户
# 应用说明

目前仅支持iOS与Android端,由于部分插件例如[sqflite](https://pub.dev/packages/sqflite)不支持Web端,所以应用也并不支持Web端。

# 注意事项

- [注意事项](https://github.com/PicGo/flutter-picgo/blob/dev/docs/注意事项.md)

# 有问题或者有更好的建议

- 欢迎提 [Issues](https://github.com/PicGo/flutter-picgo/issues)
@@ -59,13 +68,14 @@ Flutter-PicGo: 一个用于快速上传图片并获取图片URL链接的**手机
# 相关

- [PicGo](https://github.com/Molunerfinn/PicGo)
- [PicGo](https://github.com/Molunerfinn/PicGo) : PicGo 的桌面版
- [vs-picgo](https://github.com/PicGo/vs-picgo):PicGo 的 VS Code 版。

# 致谢

- [Flutter-Go](https://github.com/alibaba/flutter-go)

# [License](https://github.com/hackycy/flutter-picgo/blob/master/LICENSE)
# License

``` txt
MIT License
3 changes: 3 additions & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -50,6 +50,9 @@ android {
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName

// support multidex
multiDexEnabled true
}

signingConfigs {
Binary file added docs/hostconfig.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions docs/static/location.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Flutter-Picgo Release</title>
<script>
// var u = navigator.userAgent;
// var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //判断是否是 android终端
// var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //判断是否是 iOS终端
if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {
window.location.href = 'https://apps.apple.com/cn/app/flutter-picgo/id1519714305'
} else if (/(Android)/i.test(navigator.userAgent)) {
window.location.href = 'https://www.pgyer.com/flutter-picgo'
}
</script>
</head>

<body>
</body>

</html>
8 changes: 4 additions & 4 deletions docs/version.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"iOS": {
"versionName": "1.6.0",
"versionCode": "14"
"versionName": "1.9.1",
"versionCode": "22"
},
"Android": {
"versionName": "1.6.0",
"versionCode": "14"
"versionName": "1.9.2",
"versionCode": "23"
}
}
17 changes: 17 additions & 0 deletions docs/注意事项.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@


### 功能建议或BUG提交

> 请尽量在Github页面中发起[issue](https://github.com/PicGo/flutter-picgo/issues),否则在其他地方比较难以管理和收集建议。
### 关于Github图片上传问题

> 由于国内访问Github慢的原因,API访问也会经常出错,建议切换别的图床进行使用。
>
> 或者配置host提升访问速度,这里提供一种方式:
>
> ![](https://raw.githubusercontent.com/hackycy/flutter-picgo/dev/docs/hostconfig.jpeg)
>
> 在路由器里面配置hosts,具体配置可以查看[Github520](https://github.com/521xueweihan/GitHub520)
>
> 路由器配置hosts后连接Wi-Fi可以显著提升API的访问能力。
10 changes: 6 additions & 4 deletions docs/设计文档.md
Original file line number Diff line number Diff line change
@@ -24,11 +24,13 @@

| 版本 | 描述 |
| ---- | ------------------------------------------------ |
| 1 | pb_setting,uploaded表初始化,增加Github图床记录 |
| 1 | pb_setting,uploaded表初始化,增加Github图床记录 |
| 2 | uploaded新增info列,新增SM.MS图床记录 |
| 3 | 新增Gitee图床记录 |
| 4 | 新增Qiniu图床记录 |
| 3 | 新增Gitee图床记录 |
| 4 | 新增Qiniu图床记录 |
| 5 | 新增阿里云OSS图床记录 |
| 6 | 新增腾讯云COS图床记录 |
| 7 | 新增牛图网图床记录 |
| 7 | 新增牛图网图床记录 |
| 8 | 新增兰空图床记录 |
| 9 | 新增又拍云图床记录 |

81 changes: 20 additions & 61 deletions ios/Podfile
100755 → 100644
Original file line number Diff line number Diff line change
@@ -10,78 +10,37 @@ project 'Runner', {
'Release' => :release,
}

def parse_KV_file(file, separator='=')
file_abs_path = File.expand_path(file)
if !File.exists? file_abs_path
return [];
def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end
generated_key_values = {}
skip_line_start_symbols = ["#", "/"]
File.foreach(file_abs_path) do |line|
next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
plugin = line.split(pattern=separator)
if plugin.length == 2
podname = plugin[0].strip()
path = plugin[1].strip()
podpath = File.expand_path("#{path}", file_abs_path)
generated_key_values[podname] = podpath
else
puts "Invalid plugin specification: #{line}"
end

File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
generated_key_values
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_ios_podfile_setup

target 'Runner' do
use_frameworks!
use_modular_headers!

# Flutter Pod

copied_flutter_dir = File.join(__dir__, 'Flutter')
copied_framework_path = File.join(copied_flutter_dir, 'Flutter.framework')
copied_podspec_path = File.join(copied_flutter_dir, 'Flutter.podspec')
unless File.exist?(copied_framework_path) && File.exist?(copied_podspec_path)
# Copy Flutter.framework and Flutter.podspec to Flutter/ to have something to link against if the xcode backend script has not run yet.
# That script will copy the correct debug/profile/release version of the framework based on the currently selected Xcode configuration.
# CocoaPods will not embed the framework on pod install (before any build phases can generate) if the dylib does not exist.

generated_xcode_build_settings_path = File.join(copied_flutter_dir, 'Generated.xcconfig')
unless File.exist?(generated_xcode_build_settings_path)
raise "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end
generated_xcode_build_settings = parse_KV_file(generated_xcode_build_settings_path)
cached_framework_dir = generated_xcode_build_settings['FLUTTER_FRAMEWORK_DIR'];

unless File.exist?(copied_framework_path)
FileUtils.cp_r(File.join(cached_framework_dir, 'Flutter.framework'), copied_flutter_dir)
end
unless File.exist?(copied_podspec_path)
FileUtils.cp(File.join(cached_framework_dir, 'Flutter.podspec'), copied_flutter_dir)
end
end

# Keep pod path relative so it can be checked into Podfile.lock.
pod 'Flutter', :path => 'Flutter'

# Plugin Pods

# Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
# referring to absolute paths on developers' machines.
system('rm -rf .symlinks')
system('mkdir -p .symlinks/plugins')
plugin_pods = parse_KV_file('../.flutter-plugins')
plugin_pods.each do |name, path|
symlink = File.join('.symlinks', 'plugins', name)
File.symlink(path, symlink)
pod name, :path => File.join(symlink, 'ios')
end
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end

post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
end
flutter_additional_ios_build_settings(target)
# target.build_configurations.each do |config|
# if config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'].to_f < 8.0
# config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '8.0'
# end
# end
end
end
Loading