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 b8c8aab8
authored
2025-12-01 14:49:34 +0800
by
tanghuan
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
清理缓存的时候,弹框提示信息,让用户确认或取消操作
1 parent
e257b297
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
3 deletions
lib/ui/pages/web_page.dart
lib/ui/pages/web_page.dart
View file @
b8c8aab
import
'package:appframe/bloc/web_cubit.dart'
;
import
'package:appframe/config/constant.dart'
;
import
'package:appframe/config/locator.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_bloc/flutter_bloc.dart'
;
...
...
@@ -127,7 +128,7 @@ class WebPage extends StatelessWidget {
title:
const
Text
(
'清理缓存'
),
onTap:
()
{
Navigator
.
pop
(
ctx
);
ctx
.
read
<
WebCubit
>().
clearStorage
(
);
_showClearCacheDialog
(
ctx
);
},
),
ListTile
(
...
...
@@ -147,13 +148,20 @@ class WebPage extends StatelessWidget {
width:
double
.
infinity
,
padding:
const
EdgeInsets
.
all
(
16.0
),
child:
Center
(
child:
Text
(
'版权所有 © 2025'
,
child:
Column
(
children:
[
Text
(
'Version
${Constant.appVersion}
'
,
style:
TextStyle
(
color:
Colors
.
grey
,
fontSize:
12
,
),
),
Text
(
'Copyright © 中山班小二科技有限公司'
,
),
],
),
),
),
])),
...
...
@@ -241,4 +249,32 @@ class WebPage extends StatelessWidget {
),
);
}
void
_showClearCacheDialog
(
BuildContext
ctx
)
{
showDialog
(
context:
ctx
,
builder:
(
BuildContext
context
)
{
return
AlertDialog
(
title:
Text
(
'清理缓存'
),
content:
Text
(
'清理缓存后将需要重新登录,是否继续?'
),
actions:
<
Widget
>[
TextButton
(
child:
Text
(
'取消'
),
onPressed:
()
{
Navigator
.
of
(
context
).
pop
();
},
),
TextButton
(
child:
Text
(
'确认'
),
onPressed:
()
{
Navigator
.
of
(
context
).
pop
();
ctx
.
read
<
WebCubit
>().
clearStorage
();
ctx
.
read
<
WebCubit
>().
goLogin
();
},
),
],
);
},
);
}
}
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