Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
ethan
/
appframe
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit a63df17e
authored
2026-06-27 17:45:06 +0800
by
tanghuan
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
学习机不用根据配置文件检测APP版本更新
1 parent
4d183d79
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
19 deletions
lib/bloc/web_cubit.dart
lib/bloc/web_cubit.dart
View file @
a63df17
...
@@ -1451,25 +1451,26 @@ class WebCubit extends Cubit<WebState> with WidgetsBindingObserver {
...
@@ -1451,25 +1451,26 @@ class WebCubit extends Cubit<WebState> with WidgetsBindingObserver {
var
configVersion
=
versionConfig
[
'version'
]
as
String
;
var
configVersion
=
versionConfig
[
'version'
]
as
String
;
var
downloadUrl
=
versionConfig
[
'zip'
]
as
String
;
var
downloadUrl
=
versionConfig
[
'zip'
]
as
String
;
var
appversionCheck
=
versionConfig
[
'appversionCheck'
]
as
String
;
// var appversionCheck = versionConfig['appversionCheck'] as String;
var
appversionAndroid
=
versionConfig
[
'appversionAndroid'
]
as
String
;
// var appversionAndroid = versionConfig['appversionAndroid'] as String;
var
appversionIos
=
versionConfig
[
'appversionIos'
]
as
String
;
// var appversionIos = versionConfig['appversionIos'] as String;
if
(
appversionCheck
==
'1'
)
{
// 学习机PAD不检测APP升级
final
now
=
DateTime
.
now
();
// if (appversionCheck == '1') {
if
(
_lastAppVersionCheckTime
==
null
||
now
.
difference
(
_lastAppVersionCheckTime
!).
inHours
>=
2
)
{
// final now = DateTime.now();
if
((
Platform
.
isAndroid
&&
appversionAndroid
!=
''
&&
appversionAndroid
!=
Constant
.
appVersion
)
||
// if (_lastAppVersionCheckTime == null || now.difference(_lastAppVersionCheckTime!).inHours >= 2) {
(
Platform
.
isIOS
&&
appversionIos
!=
''
&&
appversionIos
!=
Constant
.
appVersion
))
{
// if ((Platform.isAndroid && appversionAndroid != '' && appversionAndroid != Constant.appVersion) ||
emit
(
state
.
copyWith
(
suggestAppUpgrade:
true
));
// (Platform.isIOS && appversionIos != '' && appversionIos != Constant.appVersion)) {
}
// emit(state.copyWith(suggestAppUpgrade: true));
_lastAppVersionCheckTime
=
now
;
// }
// _lastAppVersionCheckTime = now;
// 重置标志
//
_isCheckingVersion
=
false
;
// // 重置标志
// 提示了APP升级后,不再进行H5版本检测
// _isCheckingVersion = false;
return
;
// // 提示了APP升级后,不再进行H5版本检测
}
// return;
}
// }
// }
if
(
Constant
.
needUpgrade
&&
curVersion
!=
configVersion
)
{
if
(
Constant
.
needUpgrade
&&
curVersion
!=
configVersion
)
{
// 闭包中提前捕获变量,确保回调执行时读取的是当前值
// 闭包中提前捕获变量,确保回调执行时读取的是当前值
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment