Skip to content

Commit

Permalink
Merge pull request #58 from NKUST-ITC/develop
Browse files Browse the repository at this point in the history
Update to v3.1.10
  • Loading branch information
abc873693 authored Jun 25, 2019
2 parents 2f470ff + 1c2a25a commit 89b9e0b
Show file tree
Hide file tree
Showing 14 changed files with 354 additions and 249 deletions.
Binary file modified android/app/src/main/res/drawable/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/FMDB/FMDB.framework",
"${PODS_ROOT}/../.symlinks/flutter/ios/Flutter.framework",
"${PODS_ROOT}/../.symlinks/flutter/ios-release/Flutter.framework",
"${BUILT_PRODUCTS_DIR}/GoogleUtilities/GoogleUtilities.framework",
"${BUILT_PRODUCTS_DIR}/Protobuf/Protobuf.framework",
"${BUILT_PRODUCTS_DIR}/Reachability/Reachability.framework",
Expand Down
2 changes: 1 addition & 1 deletion lib/config/constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,6 @@ class Constants {
static const int NOTIFICATION_COURSE_ID = 101;
static const int NOTIFICATION_FCM_ID = 200;

static const FANS_PAGE_ID = '301942414015612';
static const FANS_PAGE_ID = '954175941266264';
static const FANS_PAGE_URL = 'https://www.facebook.com/$FANS_PAGE_ID/';
}
16 changes: 14 additions & 2 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import 'package:nkust_ap/pages/page.dart';
import 'package:nkust_ap/res/resource.dart' as Resource;
import 'package:nkust_ap/utils/app_localizations.dart';
import 'package:nkust_ap/utils/firebase_analytics_utils.dart';
import 'package:nkust_ap/utils/preferences.dart';
import 'package:nkust_ap/utils/utils.dart';
import 'package:nkust_ap/widgets/share_data_widget.dart';

Expand Down Expand Up @@ -50,19 +51,30 @@ void main() async {
}
}

class MyApp extends StatelessWidget {
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
FirebaseAnalytics analytics;
FirebaseMessaging _firebaseMessaging;
Brightness brightness = Brightness.light;

@override
Widget build(BuildContext context) {
void initState() {
if (Platform.isAndroid || Platform.isIOS) {
analytics = FirebaseAnalytics();
_firebaseMessaging = FirebaseMessaging();
_initFCM();
FA.analytics = analytics;
Preferences.init();
}
super.initState();
}

@override
Widget build(BuildContext context) {
return ShareDataWidget(
child: MaterialApp(
localeResolutionCallback:
Expand Down
10 changes: 7 additions & 3 deletions lib/pages/home/score_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -314,13 +314,17 @@ class ScorePageState extends State<ScorePage>
if (e is DioError) {
switch (e.type) {
case DioErrorType.RESPONSE:
Utils.handleResponseError(context, 'getSemester', mounted, e);
if (mounted) {
Utils.handleResponseError(context, 'getSemester', mounted, e);
}
break;
case DioErrorType.CANCEL:
break;
default:
state = _State.error;
Utils.handleDioError(context, e);
if (mounted) {
Utils.handleDioError(context, e);
}
break;
}
} else {
Expand All @@ -339,7 +343,7 @@ class ScorePageState extends State<ScorePage>
}

_getSemesterScore() async {
Helper.cancelToken.cancel("");
Helper.cancelToken?.cancel("");
Helper.cancelToken = CancelToken();
if (mounted) {
setState(() {
Expand Down
Loading

0 comments on commit 89b9e0b

Please sign in to comment.