Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
base_data_channel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PublicSource
base_data_channel
Commits
74035380
Commit
74035380
authored
Apr 19, 2023
by
tongzifang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
0d1b4757
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
0 deletions
+39
-0
common_colors.dart
lib/config/common_colors.dart
+4
-0
keep_alive_wrapper.dart
lib/utils/keep_alive_wrapper.dart
+35
-0
No files found.
lib/config/common_colors.dart
View file @
74035380
...
@@ -18,4 +18,8 @@ class CommonColor {
...
@@ -18,4 +18,8 @@ class CommonColor {
static
Color
get
color99
=>
const
Color
(
0xFF999999
);
static
Color
get
color99
=>
const
Color
(
0xFF999999
);
static
Color
get
colorEE
=>
const
Color
(
0xFFEEEEEE
);
static
Color
get
colorEE
=>
const
Color
(
0xFFEEEEEE
);
static
Color
get
color66
=>
const
Color
(
0xFF666666
);
static
Color
get
colorCC
=>
const
Color
(
0xFFCCCCCC
);
}
}
lib/utils/keep_alive_wrapper.dart
0 → 100644
View file @
74035380
import
'package:flutter/material.dart'
;
class
KeepAliveWrapper
extends
StatefulWidget
{
const
KeepAliveWrapper
({
Key
?
key
,
this
.
keepAlive
=
true
,
required
this
.
child
,
})
:
super
(
key:
key
);
final
bool
keepAlive
;
final
Widget
child
;
@override
_KeepAliveWrapperState
createState
()
=>
_KeepAliveWrapperState
();
}
class
_KeepAliveWrapperState
extends
State
<
KeepAliveWrapper
>
with
AutomaticKeepAliveClientMixin
{
@override
Widget
build
(
BuildContext
context
)
{
super
.
build
(
context
);
return
widget
.
child
;
}
@override
void
didUpdateWidget
(
covariant
KeepAliveWrapper
oldWidget
)
{
if
(
oldWidget
.
keepAlive
!=
widget
.
keepAlive
)
{
// keepAlive 状态需要更新,实现在 AutomaticKeepAliveClientMixin 中
updateKeepAlive
();
}
super
.
didUpdateWidget
(
oldWidget
);
}
@override
bool
get
wantKeepAlive
=>
widget
.
keepAlive
;
}
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