new: disk view option & chore: flutter 3.16

This commit is contained in:
lollipopkit
2023-11-19 13:15:12 +08:00
parent d3a6b1639c
commit 5660c0e0db
12 changed files with 57 additions and 92 deletions

View File

@@ -36,7 +36,7 @@ class _ServerDetailPageState extends State<ServerDetailPage>
late MediaQueryData _media;
final Order<String> _cardsOrder = [];
late final _textFactor = Stores.setting.textFactor.fetch();
late final _textFactor = TextScaler.linear(Stores.setting.textFactor.fetch());
late final _cardBuildMap = Map.fromIterables(
Defaults.detailCardOrder,
@@ -161,12 +161,12 @@ class _ServerDetailPageState extends State<ServerDetailPage>
Text(
'${percent.toStringAsFixed(1)}%',
style: const TextStyle(fontSize: 13),
textScaleFactor: _textFactor,
textScaler: _textFactor,
),
Text(
timeType,
style: const TextStyle(fontSize: 10, color: Colors.grey),
textScaleFactor: _textFactor,
textScaler: _textFactor,
),
],
);
@@ -207,12 +207,12 @@ class _ServerDetailPageState extends State<ServerDetailPage>
Text(
ss.sysVer,
style: UIs.textSize11,
textScaleFactor: _textFactor,
textScaler: _textFactor,
),
Text(
ss.uptime,
style: UIs.textSize11,
textScaleFactor: _textFactor,
textScaler: _textFactor,
),
],
),
@@ -334,13 +334,13 @@ class _ServerDetailPageState extends State<ServerDetailPage>
title: Text(
disk.dev,
style: UIs.textSize11Bold,
textScaleFactor: _textFactor,
textScaler: _textFactor,
),
contentPadding: const EdgeInsets.symmetric(horizontal: 17),
subtitle: Text(
text,
style: UIs.textSize11Grey,
textScaleFactor: _textFactor,
textScaler: _textFactor,
),
trailing: SizedBox(
height: 37,
@@ -429,7 +429,7 @@ class _ServerDetailPageState extends State<ServerDetailPage>
Text(
device,
style: UIs.textSize11Bold,
textScaleFactor: _textFactor,
textScaler: _textFactor,
maxLines: 1,
overflow: TextOverflow.fade,
textAlign: TextAlign.left,
@@ -437,7 +437,7 @@ class _ServerDetailPageState extends State<ServerDetailPage>
Text(
'${ns.sizeIn(device: device)} | ${ns.sizeOut(device: device)}',
style: UIs.textSize11Grey,
textScaleFactor: _textFactor,
textScaler: _textFactor,
)
],
),
@@ -490,7 +490,7 @@ class _ServerDetailPageState extends State<ServerDetailPage>
key: key,
text,
style: style,
textScaleFactor: _textFactor,
textScaler: _textFactor,
),
transitionBuilder: (child, animation) => FadeTransition(
opacity: animation,

View File

@@ -373,7 +373,6 @@ class _ServerPageState extends State<ServerPage>
Text(
spi.name,
style: UIs.textSize13Bold,
textScaleFactor: 1.0,
),
const Icon(
Icons.keyboard_arrow_right,
@@ -406,14 +405,12 @@ class _ServerPageState extends State<ServerPage>
child: Text(
l10n.viewErr,
style: UIs.textSize11Grey,
textScaleFactor: 1.0,
),
);
}
return Text(
topRightStr,
style: UIs.textSize11Grey,
textScaleFactor: 1.0,
);
}
@@ -434,7 +431,7 @@ class _ServerPageState extends State<ServerPage>
Widget _buildDisk(ServerStatus ss, String id) {
final rootDisk = findRootDisk(ss.disk);
final isSpeed = _diskViewSpeed[id] ?? true;
final isSpeed = _diskViewSpeed[id] ?? !Stores.setting.serverTabPreferDiskAmount.fetch();
final (r, w) = ss.diskIO.getAllSpeed();
@@ -490,14 +487,12 @@ class _ServerPageState extends State<ServerPage>
up,
style: UIs.textSize9Grey,
textAlign: TextAlign.center,
textScaleFactor: 1.0,
),
const SizedBox(height: 3),
Text(
down,
style: UIs.textSize9Grey,
textAlign: TextAlign.center,
textScaleFactor: 1.0,
)
],
);
@@ -531,7 +526,6 @@ class _ServerPageState extends State<ServerPage>
'${percent.toStringAsFixed(1)}%',
textAlign: TextAlign.center,
style: UIs.textSize11,
textScaleFactor: 1.0,
),
),
),