Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
ChatGPT
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
关振斌
ChatGPT
Commits
5f368f69
Commit
5f368f69
authored
Apr 14, 2023
by
skeyboy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复切换tabbar导致用户状态丢失的问题
parent
04afb450
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
247 additions
and
187 deletions
+247
-187
lib/pages/assistant/view.dart
lib/pages/assistant/view.dart
+18
-1
lib/pages/creation/view.dart
lib/pages/creation/view.dart
+21
-1
lib/pages/home/view.dart
lib/pages/home/view.dart
+208
-185
No files found.
lib/pages/assistant/view.dart
View file @
5f368f69
...
...
@@ -9,7 +9,7 @@ class AssistantPage extends GetView<AssistantController> {
// 主视图
Widget
_buildView
()
{
return
GridWidget
();
return
_AssistantPage
();
}
@override
...
...
@@ -29,3 +29,20 @@ class AssistantPage extends GetView<AssistantController> {
);
}
}
class
_AssistantPage
extends
StatefulWidget
{
const
_AssistantPage
({
Key
?
key
})
:
super
(
key:
key
);
@override
State
<
_AssistantPage
>
createState
()
=>
_AssistantPageState
();
}
class
_AssistantPageState
extends
State
<
_AssistantPage
>
with
AutomaticKeepAliveClientMixin
{
@override
// TODO: implement wantKeepAlive
bool
get
wantKeepAlive
=>
true
;
@override
Widget
build
(
BuildContext
context
)
{
return
GridWidget
();
}
}
lib/pages/creation/view.dart
View file @
5f368f69
...
...
@@ -9,7 +9,7 @@ class CreationPage extends GetView<CreationController> {
// 主视图
Widget
_buildView
()
{
return
GridWidget
();
return
const
_InnerCreationPage
();
// return Obx(() => Center(
// child: InkWell(
// onTap: () => controller.increment(),
...
...
@@ -40,3 +40,23 @@ class CreationPage extends GetView<CreationController> {
);
}
}
class
_InnerCreationPage
extends
StatefulWidget
{
const
_InnerCreationPage
({
Key
?
key
})
:
super
(
key:
key
);
@override
State
<
_InnerCreationPage
>
createState
()
=>
_InnerCreationPageState
();
}
class
_InnerCreationPageState
extends
State
<
_InnerCreationPage
>
with
AutomaticKeepAliveClientMixin
{
/// 防止每次切换之后自动滑动到顶部
@override
bool
get
wantKeepAlive
=>
true
;
@override
Widget
build
(
BuildContext
context
)
{
return
GridWidget
();
}
}
lib/pages/home/view.dart
View file @
5f368f69
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment