From a2b4000c912a687618946a0205949ac4a75dce2b Mon Sep 17 00:00:00 2001 From: Rainvisitor Date: Sat, 28 Sep 2019 00:00:26 +0800 Subject: [PATCH] Fix home page empty and update to v3.2.7 --- lib/api/helper.dart | 7 +++++-- lib/utils/app_localizations.dart | 4 ++-- pubspec.yaml | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/api/helper.dart b/lib/api/helper.dart index 09050455..77214f32 100644 --- a/lib/api/helper.dart +++ b/lib/api/helper.dart @@ -10,7 +10,7 @@ import 'package:nkust_ap/models/announcements_data.dart'; import 'package:nkust_ap/models/booking_bus_data.dart'; import 'package:nkust_ap/models/bus_violation_records_data.dart'; import 'package:nkust_ap/models/cancel_bus_data.dart'; -import 'package:nkust_ap/models/leave_info_data.dart'; +import 'package:nkust_ap/models/leave_submit_info_data.dart'; import 'package:nkust_ap/models/leaves_data.dart'; import 'package:nkust_ap/models/leaves_submit_data.dart'; import 'package:nkust_ap/models/library_info_data.dart'; @@ -159,7 +159,10 @@ class Helper { Future getAllAnnouncements() async { try { var response = await dio.get("/news/announcements/all"); - return AnnouncementsData.fromJson(response.data); + if (response.statusCode == 204) + return AnnouncementsData(data: []); + else + return AnnouncementsData.fromJson(response.data); } on DioError catch (dioError) { print(dioError); throw dioError; diff --git a/lib/utils/app_localizations.dart b/lib/utils/app_localizations.dart index ade9ad80..20c30913 100644 --- a/lib/utils/app_localizations.dart +++ b/lib/utils/app_localizations.dart @@ -67,7 +67,7 @@ class AppLocalizations { 'app_name': 'NKUST AP', 'update_note_title': 'Update Notes', 'update_note_content': - '1.Release new API version(will clear old preference data).\n2.Add midterm warning page.\n3.Add reward and penalty page.\n4.Impove course page.\n5.Fix some bug', + '1.Release new API version(will clear old preference data).\n2.Add midterm warning page.\n3.Add reward and penalty page.\n4.Impove course page.\n5.Add feature leave apply.\n6.Fix some bug', 'splash_content': '我們全都包了\n只剩下學校不包我們', 'share': 'Share', 'teacher_confirm_title': 'Are you a teacher?', @@ -399,7 +399,7 @@ class AppLocalizations { 'app_name': '高科校務通', 'update_note_title': '更新日誌', 'update_note_content': - '1.全新推出新的API(此更新會清除先前資料)\n2.新增期中預警\n3.新增獎懲紀錄\n4.改善課表顯示\n5.修正部分錯誤', + '1.全新推出新的API(此更新會清除先前資料)\n2.新增期中預警\n3.新增獎懲紀錄\n4.改善課表顯示\n5.新增請假申請\n6.修正部分錯誤', 'splash_content': '我們全都包了\n只剩下學校不包我們', 'share': '分享', 'teacher_confirm_title': '您是老師嗎?', diff --git a/pubspec.yaml b/pubspec.yaml index 42531198..26c88ce0 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: nkust_ap description: A new Flutter application. -version: 3.2.6+30206 +version: 3.2.7+30207 environment: sdk: ">=2.2.2 <3.0.0"