Skip to content

Commit

Permalink
Merge pull request #77 from nsysu-code-club/feature/flutter-3.19
Browse files Browse the repository at this point in the history
Feature/flutter 3.19
  • Loading branch information
abc873693 authored Aug 22, 2024
2 parents 4adda48 + 255a1b6 commit 6790b02
Show file tree
Hide file tree
Showing 32 changed files with 303 additions and 214 deletions.
2 changes: 1 addition & 1 deletion .fvm/fvm_config.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"flutterSdkVersion": "3.10.6",
"flutterSdkVersion": "3.19.3",
"flavors": {}
}
16 changes: 11 additions & 5 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Setup Java
uses: actions/setup-java@v1
with:
java-version: '11.0'
java-version: '17.0'
- name: Decrypt Android keys
run: sh ./.github/scripts/decrypt_android_keys.sh
env:
Expand All @@ -30,7 +30,7 @@ jobs:
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.10.x'
flutter-version: '3.19.x'
channel: 'stable'
- name: Decrypt dev configs
run: sh ./scripts/decrypt_dev_configs.sh
Expand All @@ -54,8 +54,14 @@ jobs:

deploy_ios:
name: iOS Deploy TestFlight
runs-on: macOS-latest
runs-on: macos-13
steps:
# Ensure the xcode version is available
- name: List Xcode installations
run: sudo ls -1 /Applications | grep "Xcode"
# Select your required version
- name: Select Xcode 15.0
run: sudo xcode-select -s /Applications/Xcode_15.0.app/Contents/Developer
- name: Checkout code
uses: actions/checkout@v3
with:
Expand All @@ -69,7 +75,7 @@ jobs:
- name: Run Flutter tasks
uses: subosito/flutter-action@v2
with:
flutter-version: '3.10.x'
flutter-version: '3.19.x'
channel: 'stable'
- name: Decrypt dev configs
run: sh ./scripts/decrypt_dev_configs.sh
Expand Down Expand Up @@ -163,7 +169,7 @@ jobs:
- name: Run Flutter tasks
uses: subosito/flutter-action@v2
with:
flutter-version: '3.10.x'
flutter-version: '3.19.x'
channel: 'stable'
- name: Decrypt dev configs
run: sh ./scripts/decrypt_dev_configs.sh
Expand Down
22 changes: 14 additions & 8 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ jobs:
- name: Setup Java
uses: actions/setup-java@v1
with:
java-version: '11.0'
java-version: '17.0'
- name: Decrypt Android keys
run: sh ./.github/scripts/decrypt_android_keys.sh
env:
KEYS_SECRET_PASSPHRASE: ${{ secrets.KEYS_SECRET_PASSPHRASE }}
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.10.x'
flutter-version: '3.19.x'
channel: 'stable'
cache: true
cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:'
Expand All @@ -45,14 +45,20 @@ jobs:

build_ios:
name: Build iOS App
runs-on: macOS-latest
runs-on: macos-13
steps:
# Ensure the xcode version is available
- name: List Xcode installations
run: sudo ls -1 /Applications | grep "Xcode"
# Select your required version
- name: Select Xcode 15.0
run: sudo xcode-select -s /Applications/Xcode_15.0.app/Contents/Developer
- name: Checkout code
uses: actions/checkout@v3
- name: Run Flutter tasks
uses: subosito/flutter-action@v2
with:
flutter-version: '3.10.x'
flutter-version: '3.19.x'
channel: 'stable'
cache: true
cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:'
Expand All @@ -72,7 +78,7 @@ jobs:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.10.x'
flutter-version: '3.19.x'
channel: 'stable'
cache: true
cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:'
Expand All @@ -97,7 +103,7 @@ jobs:
# - name: Run Flutter tasks
# uses: subosito/flutter-action@v2
# with:
# flutter-version: '3.10.x'
# flutter-version: '3.19.x'
# channel: 'stable'
# - name: Decrypt dev configs
# run: sh ./scripts/decrypt_dev_configs.sh
Expand All @@ -120,7 +126,7 @@ jobs:
- name: Run Flutter tasks
uses: subosito/flutter-action@v2
with:
flutter-version: '3.10.x'
flutter-version: '3.19.x'
channel: 'stable'
cache: true
cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:'
Expand Down Expand Up @@ -154,7 +160,7 @@ jobs:
- name: Run Flutter tasks
uses: subosito/flutter-action@v2
with:
flutter-version: '3.10.x'
flutter-version: '3.19.x'
channel: 'stable'
cache: true
cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:'
Expand Down
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 33
compileSdkVersion 34

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
Expand All @@ -39,7 +39,7 @@ android {
defaultConfig {
applicationId "com.nsysu.ap"
minSdkVersion 21
targetSdkVersion 33
targetSdkVersion 34
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand Down
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
buildscript {
ext.kotlin_version = '1.6.21'
ext.kotlin_version = '1.7.10'
repositories {
google()
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.1.3'
classpath 'com.android.tools.build:gradle:7.3.0'
classpath 'com.google.gms:google-services:4.3.5'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.5.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
Expand Down
25 changes: 24 additions & 1 deletion ios/CourseAppWidget/CourseAppWidget.swift
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ struct CourseAppWidgetEntryView: View {
.padding([.trailing, .leading], 8)
.multilineTextAlignment(.center)
}
.background(getContentBackgroudColor())
.widgetBackground(getContentBackgroudColor())
}
}
}
Expand All @@ -134,6 +134,7 @@ struct CourseAppWidget: Widget {
}
.configurationDisplayName("上課提醒")
.description("提醒本日下一堂課")
.disableContentMarginsIfNeeded()
}
}

Expand All @@ -143,3 +144,25 @@ struct CourseAppWidget_Previews: PreviewProvider {
.previewContext(WidgetPreviewContext(family: .systemSmall))
}
}

extension View {
func widgetBackground(_ backgroundView: some View) -> some View {
if #available(iOSApplicationExtension 17.0, *) {
return containerBackground(for: .widget) {
backgroundView
}
} else {
return background(backgroundView)
}
}
}

extension WidgetConfiguration {
func disableContentMarginsIfNeeded() -> some WidgetConfiguration {
if #available(iOSApplicationExtension 17.0, *) {
return self.contentMarginsDisabled()
} else {
return self
}
}
}
2 changes: 1 addition & 1 deletion ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
platform :ios, '11.0'
platform :ios, '12.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand Down
20 changes: 10 additions & 10 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,11 @@ PODS:
- nanopb (< 2.30910.0, >= 2.30908.0)
- PromisesSwift (~> 2.1)
- Flutter (1.0.0)
- flutter_inappwebview (0.0.1):
- flutter_inappwebview_ios (0.0.1):
- Flutter
- flutter_inappwebview/Core (= 0.0.1)
- flutter_inappwebview_ios/Core (= 0.0.1)
- OrderedSet (~> 5.0)
- flutter_inappwebview/Core (0.0.1):
- flutter_inappwebview_ios/Core (0.0.1):
- Flutter
- OrderedSet (~> 5.0)
- flutter_keyboard_visibility (0.0.1):
Expand Down Expand Up @@ -242,7 +242,7 @@ DEPENDENCIES:
- firebase_performance (from `.symlinks/plugins/firebase_performance/ios`)
- firebase_remote_config (from `.symlinks/plugins/firebase_remote_config/ios`)
- Flutter (from `Flutter`)
- flutter_inappwebview (from `.symlinks/plugins/flutter_inappwebview/ios`)
- flutter_inappwebview_ios (from `.symlinks/plugins/flutter_inappwebview_ios/ios`)
- flutter_keyboard_visibility (from `.symlinks/plugins/flutter_keyboard_visibility/ios`)
- flutter_local_notifications (from `.symlinks/plugins/flutter_local_notifications/ios`)
- google_sign_in_ios (from `.symlinks/plugins/google_sign_in_ios/ios`)
Expand Down Expand Up @@ -306,8 +306,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/firebase_remote_config/ios"
Flutter:
:path: Flutter
flutter_inappwebview:
:path: ".symlinks/plugins/flutter_inappwebview/ios"
flutter_inappwebview_ios:
:path: ".symlinks/plugins/flutter_inappwebview_ios/ios"
flutter_keyboard_visibility:
:path: ".symlinks/plugins/flutter_keyboard_visibility/ios"
flutter_local_notifications:
Expand Down Expand Up @@ -360,8 +360,8 @@ SPEC CHECKSUMS:
FirebasePerformance: eee2f5da94fd7e5d15487649f8fe10a90c87c174
FirebaseRemoteConfig: 5ea5834e8c518f377bf1af2d97ebd611914ebf2d
FirebaseSessions: 5f9e62cd4096e24d2011cbd845b0efceffaee1ec
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
flutter_inappwebview: bfd58618f49dc62f2676de690fc6dcda1d6c3721
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
flutter_inappwebview_ios: 97215cf7d4677db55df76782dbd2930c5e1c1ea0
flutter_keyboard_visibility: 0339d06371254c3eb25eeb90ba8d17dca8f9c069
flutter_local_notifications: 0c0b1ae97e741e1521e4c1629a459d04b9aec743
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
Expand All @@ -388,6 +388,6 @@ SPEC CHECKSUMS:
sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904
url_launcher_ios: 839c58cdb4279282219f5e248c3321761ff3c4de

PODFILE CHECKSUM: 13dcb1df7b04aa50abd9132a5b5c1a6ce68fee94
PODFILE CHECKSUM: 5ed548459577b68974dc2605a2b1952f0272b7d1

COCOAPODS: 1.12.1
COCOAPODS: 1.13.0
16 changes: 8 additions & 8 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,8 @@
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
buildPhases = (
5A70A84C204C3C82707F46B5 /* [CP] Check Pods Manifest.lock */,
A4E3F61D2525B59800343570 /* Embed App Extensions */,
A404C23825DD843200AAB332 /* ShellScript */,
9740EEB61CF901F6004384FC /* Run Script */,
97C146EA1CF9000F007C117D /* Sources */,
97C146EB1CF9000F007C117D /* Frameworks */,
Expand All @@ -226,8 +228,6 @@
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
C5C69C4274830CDFF1F48AE0 /* [CP] Embed Pods Frameworks */,
A48806D922AF5CC500608B9C /* ShellScript */,
A4E3F61D2525B59800343570 /* Embed App Extensions */,
A404C23825DD843200AAB332 /* ShellScript */,
);
buildRules = (
);
Expand Down Expand Up @@ -263,7 +263,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 1200;
LastUpgradeCheck = 1300;
LastUpgradeCheck = 1510;
ORGANIZATIONNAME = "The Chromium Authors";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
Expand Down Expand Up @@ -449,7 +449,7 @@
"${BUILT_PRODUCTS_DIR}/add_2_calendar/add_2_calendar.framework",
"${BUILT_PRODUCTS_DIR}/ap_common_plugin/ap_common_plugin.framework",
"${BUILT_PRODUCTS_DIR}/app_tracking_transparency/app_tracking_transparency.framework",
"${BUILT_PRODUCTS_DIR}/flutter_inappwebview/flutter_inappwebview.framework",
"${BUILT_PRODUCTS_DIR}/flutter_inappwebview_ios/flutter_inappwebview_ios.framework",
"${BUILT_PRODUCTS_DIR}/flutter_keyboard_visibility/flutter_keyboard_visibility.framework",
"${BUILT_PRODUCTS_DIR}/flutter_local_notifications/flutter_local_notifications.framework",
"${BUILT_PRODUCTS_DIR}/image_picker_ios/image_picker_ios.framework",
Expand Down Expand Up @@ -490,7 +490,7 @@
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/add_2_calendar.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/ap_common_plugin.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/app_tracking_transparency.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_inappwebview.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_inappwebview_ios.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_keyboard_visibility.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_local_notifications.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/image_picker_ios.framework",
Expand Down Expand Up @@ -639,7 +639,7 @@
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -778,7 +778,7 @@
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -817,7 +817,7 @@
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1300"
LastUpgradeVersion = "1510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
4 changes: 2 additions & 2 deletions lib/api/bus_helper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class BusHelper {
callback.onError(GeneralResponse.unknownError());
throw response.statusMessage ?? response.toString();
}
} on DioError catch (e) {
} on DioException catch (e) {
callback.onFailure(e);
// debugPrint(big5.decode(e.response.data));
} on Exception catch (_) {
Expand Down Expand Up @@ -96,7 +96,7 @@ class BusHelper {
callback.onError(GeneralResponse.unknownError());
throw response.statusMessage ?? response.toString();
}
} on DioError catch (e) {
} on DioException catch (e) {
callback.onFailure(e);
// debugPrint(big5.decode(e.response.data));
} on Exception catch (_) {
Expand Down
7 changes: 4 additions & 3 deletions lib/api/graduation_helper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,9 @@ class GraduationHelper {
GeneralResponse.unknownError(),
);
}
} on DioError catch (e) {
if (e.type == DioErrorType.badResponse && e.response!.statusCode == 302) {
} on DioException catch (e) {
if (e.type == DioExceptionType.badResponse &&
e.response!.statusCode == 302) {
isLogin = true;
callback.onSuccess(GeneralResponse.success());
} else {
Expand Down Expand Up @@ -219,7 +220,7 @@ class GraduationHelper {
final int endTime = DateTime.now().millisecondsSinceEpoch;
debugPrint(((endTime - startTime) / 1000.0).toString());
callback.onSuccess(graduationReportData);
} on DioError catch (e) {
} on DioException catch (e) {
callback.onFailure(e);
rethrow;
} catch (e) {
Expand Down
Loading

0 comments on commit 6790b02

Please sign in to comment.