Skip to content

Commit bd71968

Browse files
authored
Merge pull request #9 from PicGo/dev
pr:merge dev
2 parents 534c41a + c71938f commit bd71968

File tree

16 files changed

+122
-32
lines changed

16 files changed

+122
-32
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
channel: 'stable' # or: 'dev' or 'beta'
2727
- run: flutter pub get
2828
- run: flutter test
29-
- run: flutter build apk --release
29+
- run: flutter build apk --release --no-tree-shake-icons
3030
- uses: actions/upload-artifact@v2
3131
with:
3232
path: build/app/outputs/apk/release/*.apk

docs/version.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"versionCode": "16"
55
},
66
"Android": {
7-
"versionName": "1.8.0",
8-
"versionCode": "16"
7+
"versionName": "1.9.0",
8+
"versionCode": "20"
99
}
1010
}

ios/Podfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,10 @@ end
3737
post_install do |installer|
3838
installer.pods_project.targets.each do |target|
3939
flutter_additional_ios_build_settings(target)
40+
# target.build_configurations.each do |config|
41+
# if config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'].to_f < 8.0
42+
# config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '8.0'
43+
# end
44+
# end
4045
end
4146
end

ios/Podfile.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ PODS:
2020
- Flutter
2121
- shared_preferences (0.0.1):
2222
- Flutter
23-
- sqflite (0.0.1):
23+
- sqflite (0.0.2):
2424
- Flutter
25-
- FMDB (~> 2.7.2)
25+
- FMDB (>= 2.7.5)
2626
- SwiftProtobuf (1.9.0)
2727
- url_launcher (0.0.1):
2828
- Flutter
@@ -70,18 +70,18 @@ EXTERNAL SOURCES:
7070
SPEC CHECKSUMS:
7171
barcode_scan: a5c27959edfafaa0c771905bad0b29d6d39e4479
7272
Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
73-
flutter_local_notifications: 9e4738ce2471c5af910d961a6b7eadcf57c50186
73+
flutter_local_notifications: 0c0b1ae97e741e1521e4c1629a459d04b9aec743
7474
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
7575
image_picker: 9c3312491f862b28d21ecd8fdf0ee14e601b3f09
7676
MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb
7777
package_info: 873975fc26034f0b863a300ad47e7f1ac6c7ec62
7878
path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c
7979
permission_handler: eac8e15b4a1a3fba55b761d19f3f4e6b005d15b6
8080
shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d
81-
sqflite: 4001a31ff81d210346b500c55b17f4d6c7589dd0
81+
sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904
8282
SwiftProtobuf: ecbec1be9036d15655f6b3443a1c4ea693c97932
8383
url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef
8484

85-
PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c
85+
PODFILE CHECKSUM: 08e41981fcdc78ff11c898bc59c6c49635c114b3
8686

8787
COCOAPODS: 1.9.1

ios/Runner.xcodeproj/project.pbxproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@
348348
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
349349
GCC_WARN_UNUSED_FUNCTION = YES;
350350
GCC_WARN_UNUSED_VARIABLE = YES;
351-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
351+
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
352352
MTL_ENABLE_DEBUG_INFO = NO;
353353
SDKROOT = iphoneos;
354354
SUPPORTED_PLATFORMS = iphoneos;
@@ -437,7 +437,7 @@
437437
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
438438
GCC_WARN_UNUSED_FUNCTION = YES;
439439
GCC_WARN_UNUSED_VARIABLE = YES;
440-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
440+
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
441441
MTL_ENABLE_DEBUG_INFO = YES;
442442
ONLY_ACTIVE_ARCH = YES;
443443
SDKROOT = iphoneos;
@@ -487,7 +487,7 @@
487487
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
488488
GCC_WARN_UNUSED_FUNCTION = YES;
489489
GCC_WARN_UNUSED_VARIABLE = YES;
490-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
490+
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
491491
MTL_ENABLE_DEBUG_INFO = NO;
492492
SDKROOT = iphoneos;
493493
SUPPORTED_PLATFORMS = iphoneos;

lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Future<void> main() async {
2828

2929
class App extends StatefulWidget {
3030
App() {
31-
final router = new Router();
31+
final router = new FluroRouter();
3232
Routes.configureRoutes(router);
3333
Application.router = router;
3434
}

lib/routers/application.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class Application {
99
/// 通过Application设计环境变量
1010
static ENV env = ENV.DEV;
1111

12-
static Router router;
12+
static FluroRouter router;
1313

1414
/// 所有获取配置的唯一入口
1515
Map<String, String> get config {

lib/routers/routers.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class Routes {
4444
static const String settingPbUpyun = '/setting/pb/upyun';
4545
// -----------------------------------
4646

47-
static void configureRoutes(Router router) {
47+
static void configureRoutes(FluroRouter router) {
4848
router.notFoundHandler = notfoundHandler;
4949
router.define(root, handler: appHandler);
5050
router.define(notfound, handler: notfoundHandler);

lib/utils/local_notification.dart

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class LocalNotificationUtil {
3434
requestSoundPermission: false,
3535
onDidReceiveLocalNotification: null);
3636
var initializationSettings = InitializationSettings(
37-
initializationSettingsAndroid, initializationSettingsIOS);
37+
android: initializationSettingsAndroid, iOS: initializationSettingsIOS, macOS: new MacOSInitializationSettings());
3838
await _flutterLocalNotificationsPlugin.initialize(initializationSettings,
3939
onSelectNotification: (String payload) async {
4040
if (payload != null) {
@@ -84,17 +84,22 @@ class LocalNotificationUtil {
8484
static AndroidNotificationDetails uploadAndroidChannel() {
8585
return AndroidNotificationDetails(
8686
AndroidChannelId.upload_channel, '上传通知', '上传通知提示',
87-
importance: Importance.Max, priority: Priority.High, ticker: 'ticker');
87+
importance: Importance.max, priority: Priority.high, ticker: 'ticker');
8888
}
8989

9090
/// 默认IOS
9191
static IOSNotificationDetails normalIOSNotificationDetails() {
9292
return IOSNotificationDetails();
9393
}
9494

95+
/// 默认MacOS
96+
static MacOSNotificationDetails normalMacOSNotificationDetails() {
97+
return MacOSNotificationDetails();
98+
}
99+
95100
static NotificationDetails createNotificationDetails(
96-
AndroidNotificationDetails android, IOSNotificationDetails iOS) {
97-
return NotificationDetails(android, iOS);
101+
AndroidNotificationDetails android, IOSNotificationDetails iOS, MacOSNotificationDetails macOS) {
102+
return NotificationDetails(android: android, iOS: iOS, macOS: macOS);
98103
}
99104
}
100105

lib/views/home.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ class _MainTabsPageState extends State<AppPage> {
3737
items: <BottomNavigationBarItem>[
3838
BottomNavigationBarItem(
3939
icon: Icon(IconData(0xe621, fontFamily: 'iconfont')),
40-
title: Text('相册')
40+
label:'相册'
4141
),
4242
BottomNavigationBarItem(
4343
icon: Icon(IconData(0xe634, fontFamily: 'iconfont')),
44-
title: Text('设置')
44+
label: '设置'
4545
),
4646
],
4747
),

lib/views/manage_page/github_page/github_repo_page.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
import 'package:fluro/fluro.dart';
22
import 'package:flutter/material.dart';
3-
import 'package:flutter_picgo/components/loading.dart';
43
import 'package:flutter_picgo/components/manage_item.dart';
54
import 'package:flutter_picgo/model/github_content.dart';
65
import 'package:flutter_picgo/routers/application.dart';
76
import 'package:flutter_picgo/routers/routers.dart';
87
import 'package:flutter_picgo/views/manage_page/base_loading_page_state.dart';
98
import 'package:flutter_picgo/views/manage_page/github_page/github_repo_page_presenter.dart';
109
import 'package:path/path.dart' as pathlib;
11-
import 'package:flutter/services.dart';
1210
import 'package:toast/toast.dart';
1311
import 'package:url_launcher/url_launcher.dart';
1412

lib/views/manage_page/smms_page/smms_repo_page.dart

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ class SMMSRepoPage extends StatefulWidget {
1010
_SMMSRepoPageState createState() => _SMMSRepoPageState();
1111
}
1212

13+
enum SortBy { timeup, timedown, sizeup, sizedown }
14+
1315
class _SMMSRepoPageState extends BaseLoadingPageState<SMMSRepoPage>
1416
implements SMMSRepoPageContract {
1517
String errorMsg;
@@ -30,6 +32,32 @@ class _SMMSRepoPageState extends BaseLoadingPageState<SMMSRepoPage>
3032
AppBar get appBar => AppBar(
3133
title: Text('图床仓库'),
3234
centerTitle: true,
35+
actions: [
36+
PopupMenuButton<SortBy>(
37+
onSelected: (result) {
38+
sortItem(result);
39+
},
40+
icon: Icon(Icons.more_vert),
41+
itemBuilder: (BuildContext context) => <PopupMenuEntry<SortBy>>[
42+
const PopupMenuItem<SortBy>(
43+
value: SortBy.timeup,
44+
child: Text('时间升序'),
45+
),
46+
const PopupMenuItem<SortBy>(
47+
value: SortBy.timedown,
48+
child: Text('时间降序'),
49+
),
50+
const PopupMenuItem<SortBy>(
51+
value: SortBy.sizeup,
52+
child: Text('大小升序'),
53+
),
54+
const PopupMenuItem<SortBy>(
55+
value: SortBy.sizedown,
56+
child: Text('大小降序'),
57+
),
58+
],
59+
)
60+
],
3361
);
3462

3563
@override
@@ -39,6 +67,53 @@ class _SMMSRepoPageState extends BaseLoadingPageState<SMMSRepoPage>
3967
);
4068
}
4169

70+
sortItem(SortBy s) {
71+
if (this.contents != null && this.contents.length > 1) {
72+
switch (s) {
73+
case SortBy.timeup:
74+
setState(() {
75+
this.contents.sort((a, b) {
76+
return a.createdAt.compareTo(b.createdAt);
77+
});
78+
});
79+
break;
80+
case SortBy.timedown:
81+
setState(() {
82+
this.contents.sort((a, b) {
83+
if (a.createdAt < b.createdAt) {
84+
return 1;
85+
} else if (a.createdAt > b.createdAt) {
86+
return -1;
87+
} else {
88+
return 0;
89+
}
90+
});
91+
});
92+
break;
93+
case SortBy.sizeup:
94+
setState(() {
95+
this.contents.sort((a, b) {
96+
return a.size.compareTo(b.size);
97+
});
98+
});
99+
break;
100+
case SortBy.sizedown:
101+
setState(() {
102+
this.contents.sort((a, b) {
103+
if (a.size < b.size) {
104+
return 1;
105+
} else if (a.size > b.size) {
106+
return -1;
107+
} else {
108+
return 0;
109+
}
110+
});
111+
});
112+
break;
113+
}
114+
}
115+
}
116+
42117
@override
43118
Widget buildError() {
44119
return Center(

lib/views/setting_page/setting_page.dart

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,13 @@ class _SettingPageState extends State<SettingPage> {
8787
},
8888
trailing: Icon(Icons.arrow_right),
8989
),
90+
ListTile(
91+
title: Text('建议或报告问题'),
92+
onTap: () {
93+
launch('https://github.com/PicGo/flutter-picgo/issues');
94+
},
95+
trailing: Icon(Icons.arrow_right),
96+
),
9097
],
9198
),
9299
);

lib/views/upload_page/upload_page.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,8 @@ class _UploadPageState extends State<UploadPage>
343343
body,
344344
LocalNotificationUtil.createNotificationDetails(
345345
LocalNotificationUtil.uploadAndroidChannel(),
346-
LocalNotificationUtil.normalIOSNotificationDetails()));
346+
LocalNotificationUtil.normalIOSNotificationDetails(),
347+
LocalNotificationUtil.normalMacOSNotificationDetails()
348+
));
347349
}
348350
}

pubspec.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,31 +15,31 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
1515
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
1616
# Read more about iOS versioning at
1717
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
18-
version: 1.9.0+20
18+
version: 1.9.0+21
1919

2020
environment:
2121
sdk: ">=2.7.0 <3.0.0"
2222

2323
dependencies:
2424
flutter:
2525
sdk: flutter
26-
shared_preferences: ^0.5.7+3
26+
shared_preferences: ^0.5.12+4
2727
dio: ^3.0.9
2828
package_info: ^0.4.1
29-
sqflite: ^1.3.0
30-
fluro: ^1.6.3
29+
sqflite: ^1.3.2+1
30+
fluro: ^1.7.7
3131
event_bus: ^1.1.1
3232
toast: ^0.1.5
3333
image_picker: ^0.6.7+2
3434
json_serializable: ^3.3.0
3535
cached_network_image: ^2.2.0+1
36-
url_launcher: ^5.4.9
36+
url_launcher: ^5.7.10
3737
permission_handler: ^5.0.1
3838
barcode_scan: ^3.0.1
3939
provider: ^4.1.3
4040
crypto: ^2.1.4
41-
flutter_local_notifications: ^1.4.4+1
42-
pull_to_refresh: ^1.6.0
41+
flutter_local_notifications: ^3.0.1+4
42+
pull_to_refresh: ^1.6.2
4343
characters: ^1.0.0
4444

4545

test/api/tcyun_api_test.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
import 'dart:convert';
21
import 'dart:io';
32

4-
import 'package:dio/dio.dart';
53
import 'package:flutter_picgo/api/tcyun_api.dart';
64
import 'package:flutter_test/flutter_test.dart';
75
import 'package:path/path.dart' as path;

0 commit comments

Comments
 (0)