Compare commits

..

No commits in common. "1fbb102370c7cd399ec06f04ef70066c95f10441" and "a759583ca0e808c4d9afacfd829c8b46abe0c134" have entirely different histories.

5 changed files with 27 additions and 171 deletions

View File

@ -72,7 +72,7 @@ class _TheLoginState extends ConsumerState<TheLogin> with CommonMixin {
@override @override
void initState() { void initState() {
Future.delayed(Duration(seconds: 2), () => sysProtocol(context)); Future.delayed(Duration(seconds: 3), () => sysProtocol(context));
Future(() { Future(() {
// Provider // Provider
ref.read(userTokenProvider.notifier).clean(); // ref.read(userTokenProvider.notifier).clean(); //

View File

@ -27,6 +27,7 @@ import 'package:marking_app/pages/marking/index.dart';
import 'package:marking_app/provider/user_provider.dart'; import 'package:marking_app/provider/user_provider.dart';
import 'package:marking_app/utils/index.dart'; import 'package:marking_app/utils/index.dart';
import 'package:marking_app/utils/request/rest_client.dart'; import 'package:marking_app/utils/request/rest_client.dart';
import 'package:marking_app/utils/sys_protocol.dart';
import 'package:package_info/package_info.dart'; import 'package:package_info/package_info.dart';
import 'homework_correction/job_home.dart'; import 'homework_correction/job_home.dart';
@ -69,6 +70,7 @@ class TheMainPageState extends ConsumerState<TheMainPage> with CommonMixin {
void initState() { void initState() {
_pageController = PageController(initialPage: tabIndex); _pageController = PageController(initialPage: tabIndex);
_otherFocusNode = FocusNode(); _otherFocusNode = FocusNode();
Future.delayed(Duration(seconds: 1), () => sysProtocol(context));
// APP升级校验在登录后 // APP升级校验在登录后
_userListener = ref.read(userProvider.notifier).addListener((state) { _userListener = ref.read(userProvider.notifier).addListener((state) {
if (state.id != '0' && state.id != '') { if (state.id != '0' && state.id != '') {

File diff suppressed because one or more lines are too long

View File

@ -41,7 +41,6 @@ class FastData {
static const String _INPUT_KEYBOARD_GUIDE_PAGE_WORK = "APP:MARKING:GUIDE_PAGE:WORK"; static const String _INPUT_KEYBOARD_GUIDE_PAGE_WORK = "APP:MARKING:GUIDE_PAGE:WORK";
// //
static const String _SYS_PROTOCOL = "APP:SYS:PROTOCOL"; static const String _SYS_PROTOCOL = "APP:SYS:PROTOCOL";
static const String _SYS_PROTOCOL_SHOW = "APP:SYS:PROTOCOL_SHOW";
static SharedPreferences? _prefs; static SharedPreferences? _prefs;
@ -287,19 +286,4 @@ class FastData {
SharedPreferences thePrefs = await getSharedInstance(); SharedPreferences thePrefs = await getSharedInstance();
thePrefs.remove(_SYS_PROTOCOL); thePrefs.remove(_SYS_PROTOCOL);
} }
Future<bool> setSysProtocolShow(bool val) async {
SharedPreferences thePrefs = await getSharedInstance();
return await thePrefs.setBool(_SYS_PROTOCOL_SHOW, val);
}
Future<bool?> getSysProtocolShow([SharedPreferences? thePrefs]) async {
if (thePrefs == null) thePrefs = await getSharedInstance();
return thePrefs.getBool(_SYS_PROTOCOL_SHOW);
}
void cleanSysProtocolShow() async {
SharedPreferences thePrefs = await getSharedInstance();
thePrefs.remove(_SYS_PROTOCOL_SHOW);
}
} }

View File

@ -74,7 +74,6 @@ class Protocol extends Dialog {
], ],
), ),
), ),
SizedBox(height: 10.h),
Row( Row(
children: [ children: [
Expanded( Expanded(
@ -123,25 +122,17 @@ class Protocol extends Dialog {
} }
/// ///
Future<void> sysProtocol(BuildContext context) async { void sysProtocol(BuildContext context) async {
bool? _sysProtocol = await FastData.getInstance().getSysProtocol(); bool? _sysProtocol = await FastData.getInstance().getSysProtocol();
if (_sysProtocol == null || !_sysProtocol) { if (_sysProtocol == null || !_sysProtocol) {
print('进来这里....'); print('进来这里....');
bool? _sysProtocolShow = await FastData.getInstance().getSysProtocolShow();
if (_sysProtocolShow != true) { showDialog(
try { context: context,
await FastData.getInstance().setSysProtocolShow(true); barrierDismissible: false,
return showDialog( builder: (ctx) {
context: context, return Protocol(ctx);
barrierDismissible: false, },
// useRootNavigator: false, );
builder: (ctx) => Protocol(ctx),
);
} catch (e) {
FastData.getInstance().cleanSysProtocol();
} finally {
FastData.getInstance().cleanSysProtocolShow();
}
}
} }
} }