Skip to content

Commit

Permalink
Remove reset password feature (#51)
Browse files Browse the repository at this point in the history
* fix: remove reset password feature

* chore: upgrade packages

* chore: upgrade version number
  • Loading branch information
Xanonymous-GitHub authored Jan 3, 2022
1 parent f083896 commit f9a857b
Show file tree
Hide file tree
Showing 14 changed files with 65 additions and 340 deletions.
16 changes: 8 additions & 8 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,14 @@ flutter {

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.3.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test:runner:1.4.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.google.code.gson:gson:2.8.6'
implementation "androidx.media:media:1.2.1"
implementation 'com.google.firebase:firebase-analytics:18.0.1'
implementation 'com.google.firebase:firebase-crashlytics:17.3.0'
implementation 'com.google.firebase:firebase-messaging:21.0.1'
implementation 'com.google.code.gson:gson:2.8.9'
implementation "androidx.media:media:1.4.3"
implementation 'com.google.firebase:firebase-analytics:20.0.2'
implementation 'com.google.firebase:firebase-crashlytics:18.2.6'
implementation 'com.google.firebase:firebase-messaging:23.0.0'
implementation "androidx.multidex:multidex:2.0.1"
}
6 changes: 3 additions & 3 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
buildscript {
ext.kotlin_version = '1.4.21'
ext.kotlin_version = '1.6.10'
repositories {
google()
jcenter()
Expand All @@ -8,8 +8,8 @@ buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:4.0.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.4'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.4.1'
classpath 'com.google.gms:google-services:4.3.10'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.8.1'
}
}

Expand Down
12 changes: 3 additions & 9 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ PODS:
- firebase_crashlytics (0.4.0-1):
- Firebase/Crashlytics (= 7.3.0)
- firebase_core
- firebase_messaging (8.0.0-dev.14):
- firebase_messaging (8.0.0-dev.15):
- Firebase/Messaging (= 7.3.0)
- firebase_core
- Flutter
Expand Down Expand Up @@ -128,8 +128,6 @@ PODS:
- Flutter (1.0.0)
- flutter_downloader (0.0.1):
- Flutter
- flutter_hls_parser (0.0.1):
- Flutter
- flutter_inappwebview (0.0.1):
- Flutter
- flutter_local_notifications (0.0.1):
Expand Down Expand Up @@ -225,7 +223,6 @@ DEPENDENCIES:
- firebase_remote_config (from `.symlinks/plugins/firebase_remote_config/ios`)
- Flutter (from `Flutter`)
- flutter_downloader (from `.symlinks/plugins/flutter_downloader/ios`)
- flutter_hls_parser (from `.symlinks/plugins/flutter_hls_parser/ios`)
- flutter_inappwebview (from `.symlinks/plugins/flutter_inappwebview/ios`)
- flutter_local_notifications (from `.symlinks/plugins/flutter_local_notifications/ios`)
- flutter_webview_plugin (from `.symlinks/plugins/flutter_webview_plugin/ios`)
Expand Down Expand Up @@ -294,8 +291,6 @@ EXTERNAL SOURCES:
:path: Flutter
flutter_downloader:
:path: ".symlinks/plugins/flutter_downloader/ios"
flutter_hls_parser:
:path: ".symlinks/plugins/flutter_hls_parser/ios"
flutter_inappwebview:
:path: ".symlinks/plugins/flutter_inappwebview/ios"
flutter_local_notifications:
Expand Down Expand Up @@ -341,7 +336,7 @@ SPEC CHECKSUMS:
firebase_analytics: 41043f6e14fc9bc27c3f05217ab7f2b0ad9b41eb
firebase_core: 91b27774a52f41f8b58484a75edf71197ac01c59
firebase_crashlytics: e6ecb908f6249ce3757d18a812819a41495bf1cb
firebase_messaging: d039d8279704fc1e3d05e0a2bb2ce7dc29ee6be8
firebase_messaging: caf0273c76e54f0a10dfe5048ac47b89e75bb78a
firebase_remote_config: 1c56b7b8caa840aa2e9432e66bf606d10f492fc9
FirebaseABTesting: 9d9c21ed27a1ac7213fe377cde655434da9c16d2
FirebaseAnalytics: 2580c2d62535ae7b644143d48941fcc239ea897a
Expand All @@ -354,7 +349,6 @@ SPEC CHECKSUMS:
FirebaseRemoteConfig: 826fad8bec5ce1912ef97a124d6ec0ce4dcf6ec1
Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
flutter_downloader: 058b9c41564a90500f67f3e432e3524613a7fd83
flutter_hls_parser: be41df963ec4f909fb5c318d483c4483556553e0
flutter_inappwebview: 69dfbac46157b336ffbec19ca6dfd4638c7bf189
flutter_local_notifications: 0c0b1ae97e741e1521e4c1629a459d04b9aec743
flutter_webview_plugin: ed9e8a6a96baf0c867e90e1bce2673913eeac694
Expand Down Expand Up @@ -386,4 +380,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: 8b541a76507f680279d394a3d6fb96365572f7c5

COCOAPODS: 1.9.3
COCOAPODS: 1.11.2
10 changes: 5 additions & 5 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 53;
objectVersion = 55;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -169,7 +169,7 @@
};
};
buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
compatibilityVersion = "Xcode 11.4";
compatibilityVersion = "Xcode 13.0";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
Expand Down Expand Up @@ -386,7 +386,7 @@
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -526,7 +526,7 @@
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -558,7 +558,7 @@
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
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 = "1230"
LastUpgradeVersion = "1320"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
22 changes: 2 additions & 20 deletions lib/generated/l10n.dart

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

5 changes: 1 addition & 4 deletions lib/src/connector/NTUTConnector.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import 'package:intl/intl.dart';

enum NTUTConnectorStatus {
LoginSuccess,
PasswordExpiredWarning,
AccountLockWarning, //帳號鎖住
AccountPasswordIncorrect,
AuthCodeFailError, //驗證碼錯誤
Expand Down Expand Up @@ -60,9 +59,7 @@ class NTUTConnector {
UserInfoJson userInfo = UserInfoJson.fromJson(jsonMap);
Model.instance.setUserInfo(userInfo);
Model.instance.saveUserData();
if (userInfo.passwordExpiredRemind.isNotEmpty) {
return NTUTConnectorStatus.PasswordExpiredWarning;
}
// if the user's password is nearly to expired, `userInfo.passwordExpiredRemind.isNotEmpty` will be true.
return NTUTConnectorStatus.LoginSuccess;
} else {
String errorMsg = jsonMap["errorMsg"];
Expand Down
30 changes: 0 additions & 30 deletions lib/src/task/ntut/NTUTChangePasswordTask.dart

This file was deleted.

22 changes: 3 additions & 19 deletions lib/src/task/ntut/NTUTTask.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@ import 'package:flutter_app/src/store/Model.dart';
import 'package:flutter_app/src/task/Task.dart';
import 'package:flutter_app/src/task/ntutapp/NTUTAppTask.dart';
import 'package:flutter_app/ui/other/ErrorDialog.dart';
import 'package:flutter_app/ui/pages/password/ChangePassword.dart';
import 'package:flutter_app/ui/screen/LoginScreen.dart';
import 'package:get/get.dart';

import '../DialogTask.dart';

class NTUTTask<T> extends DialogTask<T> {
static bool _remindPasswordExpiredWarning = false;
static bool _isLogin = false;

NTUTTask(name) : super(name);
Expand All @@ -27,7 +25,7 @@ class NTUTTask<T> extends DialogTask<T> {
name = "NTUTTask " + name;
String account = Model.instance.getAccount();
String password = Model.instance.getPassword();
if(account.isEmpty || password.isEmpty){
if (account.isEmpty || password.isEmpty) {
return TaskStatus.GiveUp;
}
super.onStart(R.current.loginNTUT);
Expand All @@ -36,8 +34,10 @@ class NTUTTask<T> extends DialogTask<T> {
NTUTAppTask.isLogin = false;
if (value == NTUTConnectorStatus.LoginSuccess) {
_isLogin = true;
print('#########################');
return TaskStatus.Success;
} else {
print('@@@@@@@@@@@@@@@@@@@@@@@@@@');
return await _onError(value);
}
}
Expand All @@ -47,22 +47,6 @@ class NTUTTask<T> extends DialogTask<T> {
desc: "",
);
switch (value) {
case NTUTConnectorStatus.PasswordExpiredWarning:
if (_remindPasswordExpiredWarning)
return TaskStatus.Success; //只執行一次避免進入無限迴圈
_remindPasswordExpiredWarning = true;
parameter.dialogType = DialogType.INFO;
parameter.title = R.current.warning;
parameter.desc = R.current.passwordExpiredWarning;
parameter.btnOkText = R.current.update;
parameter.btnOkOnPress = () async {
await ChangePassword.show();
Get.back<bool>(result: false);
};
parameter.btnCancelOnPress = () {
Get.back<bool>(result: true);
};
break;
case NTUTConnectorStatus.AccountLockWarning:
parameter.dialogType = DialogType.INFO;
parameter.desc = R.current.accountLock;
Expand Down
30 changes: 6 additions & 24 deletions lib/ui/pages/other/OtherPage.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:auto_size_text/auto_size_text.dart';
import 'package:awesome_dialog/awesome_dialog.dart';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
Expand All @@ -17,7 +16,6 @@ import 'package:flutter_app/ui/other/ErrorDialog.dart';
import 'package:flutter_app/ui/other/MyToast.dart';
import 'package:flutter_app/ui/other/RouteUtils.dart';
import 'package:flutter_app/ui/pages/logconsole/log_console.dart';
import 'package:flutter_app/ui/pages/password/ChangePassword.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:flutter_staggered_animations/flutter_staggered_animations.dart';
import 'package:get/get.dart';
Expand All @@ -30,7 +28,6 @@ enum onListViewPress {
About,
Login,
SubSystem,
ChangePassword
}

class OtherPage extends StatefulWidget {
Expand Down Expand Up @@ -62,13 +59,6 @@ class _OtherPageState extends State<OtherPage> {
"title": R.current.fileViewer,
"onPress": onListViewPress.FileViewer
},
if (Model.instance.getPassword().isNotEmpty)
{
"icon": EvaIcons.syncOutline,
"color": Colors.lightGreen,
"title": R.current.changePassword,
"onPress": onListViewPress.ChangePassword
},
if (Model.instance.getPassword().isNotEmpty)
{
"icon": EvaIcons.undoOutline,
Expand All @@ -81,7 +71,7 @@ class _OtherPageState extends State<OtherPage> {
"icon": EvaIcons.logIn,
"color": Colors.teal[400],
"title": R.current.login,
"onPress": onListViewPress.Login
"onPress": onListViewPress.Login,
},
{
"icon": EvaIcons.messageSquareOutline,
Expand Down Expand Up @@ -147,9 +137,6 @@ class _OtherPageState extends State<OtherPage> {
} catch (e) {}
RouteUtils.toWebViewPluginPage(R.current.feedback, link);
break;
case onListViewPress.ChangePassword:
ChangePassword.show();
break;
default:
MyToast.show(R.current.noFunction);
break;
Expand Down Expand Up @@ -206,8 +193,7 @@ class _OtherPageState extends State<OtherPage> {
backgroundImage: imageProvider,
),
useOldImageOnUrlChange: true,
placeholder: (context, url) =>
SpinKitPouringHourglass(color: Colors.white),
placeholder: (context, url) => SpinKitPouringHourglass(color: Colors.white),
errorWidget: (context, url, error) {
Log.e(error.toString());
return Icon(Icons.error);
Expand Down Expand Up @@ -245,8 +231,7 @@ class _OtherPageState extends State<OtherPage> {
task.openLoadingDialog = false;
taskFlow.addTask(task);
return Container(
padding:
EdgeInsets.only(top: 24.0, left: 24.0, right: 24.0, bottom: 24.0),
padding: EdgeInsets.only(top: 24.0, left: 24.0, right: 24.0, bottom: 24.0),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Expand All @@ -257,12 +242,10 @@ class _OtherPageState extends State<OtherPage> {
child: FutureBuilder<bool>(
future: taskFlow.start(),
builder: (BuildContext context, AsyncSnapshot<bool> snapshot) {
if (snapshot.connectionState == ConnectionState.done &&
snapshot.data == true) {
if (snapshot.connectionState == ConnectionState.done && snapshot.data == true) {
return userImage;
} else {
return SpinKitPouringHourglass(
color: Theme.of(context).accentColor);
return SpinKitPouringHourglass(color: Theme.of(context).accentColor);
}
},
),
Expand Down Expand Up @@ -290,8 +273,7 @@ class _OtherPageState extends State<OtherPage> {
_onListViewPress(data['onPress']);
},
child: Container(
padding:
EdgeInsets.only(top: 24.0, left: 24.0, right: 24.0, bottom: 24.0),
padding: EdgeInsets.only(top: 24.0, left: 24.0, right: 24.0, bottom: 24.0),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Expand Down
Loading

0 comments on commit f9a857b

Please sign in to comment.