- make the refresh interval setting makes effect immediately.
- auto stop/restart status update when app goto background/resume
This commit is contained in:
Junyuan Feng
2022-01-02 19:06:26 +08:00
parent 7fb8c88ab8
commit e08f37fedc
6 changed files with 57 additions and 14 deletions

View File

@@ -210,8 +210,8 @@ class _ServerDetailPageState extends State<ServerDetailPage>
_buildMemExplain(convertMB(ss.memory.used), pColor),
_buildMemExplain(
convertMB(ss.memory.cache), pColor.withAlpha(77)),
_buildMemExplain(
convertMB(ss.memory.total - ss.memory.avail), progressColor.resolve(context))
_buildMemExplain(convertMB(ss.memory.total - ss.memory.used),
progressColor.resolve(context))
],
),
const SizedBox(
@@ -243,7 +243,7 @@ class _ServerDetailPageState extends State<ServerDetailPage>
));
}
Widget _buildMemExplain(String type, Color color) {
Widget _buildMemExplain(String value, Color color) {
return Row(
children: [
Container(
@@ -252,7 +252,12 @@ class _ServerDetailPageState extends State<ServerDetailPage>
width: 11,
),
const SizedBox(width: 4),
Text(type, style: style11, textScaleFactor: 1.0)
Text(
value,
style: style11,
textScaleFactor: 1.0,
textAlign: TextAlign.center,
)
],
);
}

View File

@@ -67,7 +67,7 @@ class _ServerPageState extends State<ServerPage>
child: AnimationLimiter(
child: Column(
children: AnimationConfiguration.toStaggeredList(
duration: const Duration(milliseconds: 777),
duration: const Duration(milliseconds: 477),
childAnimationBuilder: (widget) => SlideAnimation(
verticalOffset: 77.0,
child: FadeInAnimation(
@@ -155,7 +155,9 @@ class _ServerPageState extends State<ServerPage>
accelerationCurve: Curves.linear,
decelerationDuration: const Duration(seconds: 3),
decelerationCurve: Curves.linear,
text: topRightStr, textScaleFactor: 1.0, style: style),
text: topRightStr,
textScaleFactor: 1.0,
style: style),
)
: Text(topRightStr, style: style, textScaleFactor: 1.0),
],