Skip to content

Commit

Permalink
Merge pull request #40 from NKUST-ITC/develop
Browse files Browse the repository at this point in the history
Update to v3.1.2
  • Loading branch information
abc873693 authored Mar 19, 2019
2 parents 29b5d14 + 645cf1c commit 1abab03
Show file tree
Hide file tree
Showing 15 changed files with 156 additions and 101 deletions.
44 changes: 44 additions & 0 deletions POLICY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
高科校務通由國立高雄科技大學資訊研習社團隊(以下稱「團隊」)所提供。我們十分重視您的隱私權保護,
將依個人資料保護法及本隱私權政策蒐集、處理及利用您的個人資料,並且提供您對個人資料權利之行使與保護。
若您不同意本隱私權政策之全部或部份者,請您停止使用本APP服務。

1. 本隱私權政策適用範圍
===
請您在於使用高科校務通服務前,確認您已審閱並同意本隱私權政策所列全部條款,若您不同意全部或部分者,則請勿使用本高科校務通服務。

本隱私權政策僅適用於本高科校務通對您個人資料所為蒐集、處理與利用,不及於其他非本團隊所有或控制之其他團隊或個人。您可能經由本高科校務通連結至第三人所經營之活動,各該活動為之個人資料蒐集係依其活動之隱私權政策規定處理,與本團隊無涉。

2.個人資料保護法應告知事項
===
1. 蒐集機關名稱:高科校務通團隊。
2. 蒐集之目的:提供相關校務查詢服務,校車訂閱服務,缺曠課服務等。
3. 個人資料類別:
* 識別類 (學號)
* 其他類 (使用偏好,系統自動紀錄之軌跡資訊等)


依據個人資料保護法第三條,您就您的個人資料享有以下權力:
* 查詢或請求閱覽。
* 請求制給副本。
* 請求補正或更正。
* 請求停止蒐集、處理或利用。
* 請求刪除。



3. 個人資料蒐集、處理及利用說明
===
高科校務通服務將利用您的國立高雄科技大學學號與密碼,登入校務系統、請假系統、與校車系統。

資料的處理將不會儲存在我們伺服器上,將直接轉發到使用者客戶端上。


4. 隱私權政策之修改
===

隱私權政策如經修改,將於本文公告。若您不同意該等變更或修改,請停止繼續使用本服務,並依本隱私權政策規定通知本團隊停止蒐集、處理及利用您的個人資料。

問題和建議
===

如果您有任何問題或建議,請與我們聯繫。
6 changes: 3 additions & 3 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@
TargetAttributes = {
97C146ED1CF9000F007C117D = {
CreatedOnToolsVersion = 7.3.1;
DevelopmentTeam = 75S866VSMR;
DevelopmentTeam = R7BC26UNC9;
LastSwiftMigration = 0910;
ProvisioningStyle = Automatic;
SystemCapabilities = {
Expand Down Expand Up @@ -513,7 +513,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 75S866VSMR;
DEVELOPMENT_TEAM = R7BC26UNC9;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
Expand Down Expand Up @@ -547,7 +547,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 75S866VSMR;
DEVELOPMENT_TEAM = R7BC26UNC9;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
Expand Down
3 changes: 3 additions & 0 deletions ios/Runner.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 18 additions & 7 deletions lib/models/user_info.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ class UserInfo {
String message;

UserInfo(
{this.educationSystem,
this.department,
this.className,
this.studentId,
this.studentNameCht,
this.studentNameEng,
{this.educationSystem = "",
this.department = "",
this.className = "",
this.studentId = "",
this.studentNameCht = "",
this.studentNameEng = "",
this.status,
this.message});
this.message = ""});

UserInfo.fromJson(Map<String, dynamic> json) {
educationSystem = json['education_system'];
Expand All @@ -41,4 +41,15 @@ class UserInfo {
data['message'] = this.message;
return data;
}

void setData(UserInfo userInfo) {
educationSystem = userInfo.educationSystem;
department = userInfo.department;
className = userInfo.className;
studentId = userInfo.studentId;
studentNameCht = userInfo.studentNameCht;
studentNameEng = userInfo.studentNameEng;
status = userInfo.status;
message = userInfo.message;
}
}
7 changes: 5 additions & 2 deletions lib/pages/home/bus/bus_reservations_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,11 @@ class BusReservationsPageState extends State<BusReservationsPage>
),
);
default:
return ListView(
children: busReservationWeights,
return RefreshIndicator(
onRefresh: () => _getBusReservations(),
child: ListView(
children: busReservationWeights,
),
);
}
}
Expand Down
11 changes: 7 additions & 4 deletions lib/pages/home/bus/bus_reserve_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,12 @@ class BusReservePageState extends State<BusReservePage>
),
);
default:
return ListView(
physics: const NeverScrollableScrollPhysics(),
children: _renderBusTimeWidgets(),
return RefreshIndicator(
onRefresh: () => _getBusTimeTables(),
child: ListView(
physics: const NeverScrollableScrollPhysics(),
children: _renderBusTimeWidgets(),
),
);
}
}
Expand Down Expand Up @@ -225,7 +228,7 @@ class BusReservePageState extends State<BusReservePage>
SliverAppBar(
leading: Container(),
expandedHeight: orientation == Orientation.portrait
? MediaQuery.of(context).size.height * 0.19
? MediaQuery.of(context).size.height * 0.20
: MediaQuery.of(context).size.width * 0.19,
floating: true,
backgroundColor: Colors.transparent,
Expand Down
14 changes: 8 additions & 6 deletions lib/pages/home/info/schedule_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,14 @@ class SchedulePageState extends State<SchedulePage>
scheduleList = ScheduleData.toList(jsonArray);
scheduleWeights.clear();
for (var i in scheduleList) scheduleWeights.addAll(_scheduleItem(i));
setState(() {
if (scheduleList.length == 0)
state = _State.empty;
else
state = _State.finish;
});
if (mounted) {
setState(() {
if (scheduleList.length == 0)
state = _State.empty;
else
state = _State.finish;
});
}
}
}

Expand Down
54 changes: 19 additions & 35 deletions lib/pages/home/user_info_page.dart
Original file line number Diff line number Diff line change
@@ -1,25 +1,34 @@
import 'package:cached_network_image/cached_network_image.dart';
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:nkust_ap/models/user_info.dart';
import 'package:nkust_ap/res/colors.dart' as Resource;
import 'package:nkust_ap/utils/global.dart';
import 'package:nkust_ap/widgets/drawer_body.dart';

enum _Status { loading, finish, error, empty }

class UserInfoPageRoute extends MaterialPageRoute {
UserInfoPageRoute()
: super(builder: (BuildContext context) => new UserInfoPage());
final UserInfo userInfo;

UserInfoPageRoute(this.userInfo)
: super(
builder: (BuildContext context) =>
new UserInfoPage(userInfo: userInfo));

@override
Widget buildPage(BuildContext context, Animation<double> animation,
Animation<double> secondaryAnimation) {
return new FadeTransition(opacity: animation, child: new UserInfoPage());
return new FadeTransition(
opacity: animation, child: new UserInfoPage(userInfo: userInfo));
}
}

class UserInfoPage extends StatefulWidget {
static const String routerName = "/userInfo";
static const String routerName = "/widget.userInfo";
final UserInfo userInfo;

const UserInfoPage({Key key, this.userInfo}) : super(key: key);

@override
UserInfoPageState createState() => new UserInfoPageState();
Expand All @@ -34,7 +43,7 @@ class UserInfoPageState extends State<UserInfoPage>
void initState() {
super.initState();
FA.setCurrentScreen("UserInfoPage", "user_info_page.dart");
if (userInfo == null) _getUserInfo();
if (pictureUrl == null || pictureUrl.isEmpty) _getUserPicture();
}

@override
Expand Down Expand Up @@ -79,27 +88,27 @@ class UserInfoPageState extends State<UserInfoPage>
children: <Widget>[
ListTile(
title: Text(app.studentNameCht),
subtitle: Text(userInfo.studentNameCht),
subtitle: Text(widget.userInfo.studentNameCht),
),
Divider(height: 1.0),
ListTile(
title: Text(app.educationSystem),
subtitle: Text(userInfo.educationSystem),
subtitle: Text(widget.userInfo.educationSystem),
),
Divider(height: 1.0),
ListTile(
title: Text(app.department),
subtitle: Text(userInfo.department),
subtitle: Text(widget.userInfo.department),
),
Divider(height: 1.0),
ListTile(
title: Text(app.studentClass),
subtitle: Text(userInfo.className),
subtitle: Text(widget.userInfo.className),
),
Divider(height: 1.0),
ListTile(
title: Text(app.studentId),
subtitle: Text(userInfo.studentId),
subtitle: Text(widget.userInfo.studentId),
),
],
),
Expand Down Expand Up @@ -145,29 +154,4 @@ class UserInfoPageState extends State<UserInfoPage>
}
});
}

_getUserInfo() {
setState(() {
state = _Status.loading;
});
Helper.instance.getUsersInfo().then((response) {
if (this.mounted) {
setState(() {
userInfo = response;
_getUserPicture();
state = _Status.finish;
});
}
}).catchError((e) {
assert(e is DioError);
DioError dioError = e as DioError;
switch (dioError.type) {
case DioErrorType.RESPONSE:
Utils.handleResponseError(context, 'getUserInfo', mounted, e);
break;
default:
break;
}
});
}
}
28 changes: 27 additions & 1 deletion lib/pages/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class HomePageState extends State<HomePage> {

int _currentTabIndex = 0;
int _currentNewsIndex = 0;
UserInfo userInfo = UserInfo();

List<Widget> newsWidgets = [];
List<News> newsList = [];
Expand All @@ -47,6 +48,7 @@ class HomePageState extends State<HomePage> {
super.initState();
FA.setCurrentScreen("HomePage", "home_page.dart");
_getAllNews();
_getUserInfo();
}

@override
Expand Down Expand Up @@ -156,7 +158,7 @@ class HomePageState extends State<HomePage> {
)
],
),
drawer: DrawerBody(),
drawer: DrawerBody(userInfo: userInfo),
body: OrientationBuilder(builder: (_, orientation) {
return Container(
padding: EdgeInsets.symmetric(
Expand Down Expand Up @@ -272,6 +274,30 @@ class HomePageState extends State<HomePage> {
});
}

_getUserInfo() {
Helper.instance.getUsersInfo().then((response) {
if (this.mounted) {
setState(() {
userInfo = response;
});
FA.setUserProperty('department', userInfo.department);
FA.setUserId(userInfo.studentId);
}
}).catchError((e) {
if (e is DioError) {
switch (e.type) {
case DioErrorType.RESPONSE:
Utils.handleResponseError(context, 'getUserInfo', mounted, e);
break;
default:
break;
}
} else {
throw e;
}
});
}

void _showLogoutDialog() {
showDialog(
context: context,
Expand Down
1 change: 0 additions & 1 deletion lib/pages/login_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,6 @@ class LoginPageState extends State<LoginPage>
setState(() {
isAutoLogin = false;
pictureUrl = "";
userInfo = null;
});
}
}
4 changes: 2 additions & 2 deletions lib/utils/firebase_analytics_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class FA {
static Future<void> logApiEvent(String type, int status) async {
PackageInfo packageInfo = await PackageInfo.fromPlatform();
await analytics.logEvent(
name: 'ap-api',
name: 'ap_api',
parameters: <String, dynamic>{
'type': type,
'status': status,
Expand All @@ -45,7 +45,7 @@ class FA {
static Future<void> logAESErrorEvent(String encryptPassword) async {
PackageInfo packageInfo = await PackageInfo.fromPlatform();
await analytics.logEvent(
name: 'aes-error',
name: 'aes_error',
parameters: <String, dynamic>{
'type': encryptPassword,
'version': packageInfo.version,
Expand Down
2 changes: 1 addition & 1 deletion lib/widgets/default_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class DefaultDialog extends StatelessWidget {
this.title,
this.contentWidget,
this.actionText,
this.actionFunction})
@required this.actionFunction})
: super(key: key);

static showSample(BuildContext context) => showDialog(
Expand Down
Loading

0 comments on commit 1abab03

Please sign in to comment.