new: disk view option & chore: flutter 3.16
This commit is contained in:
@@ -216,8 +216,7 @@ class _FullScreenPageState extends State<FullScreenPage> with AfterLayoutMixin {
|
||||
Text(
|
||||
spi.name,
|
||||
style:
|
||||
const TextStyle(fontWeight: FontWeight.bold, fontSize: 19),
|
||||
textScaleFactor: 1.0,
|
||||
const TextStyle(fontWeight: FontWeight.bold, fontSize: 19,),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
const Icon(
|
||||
@@ -244,7 +243,6 @@ class _FullScreenPageState extends State<FullScreenPage> with AfterLayoutMixin {
|
||||
return Text(
|
||||
topRightStr,
|
||||
style: UIs.textSize11Grey,
|
||||
textScaleFactor: 1.0,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -255,7 +253,6 @@ class _FullScreenPageState extends State<FullScreenPage> with AfterLayoutMixin {
|
||||
text,
|
||||
style: const TextStyle(fontSize: 13),
|
||||
textAlign: TextAlign.center,
|
||||
textScaleFactor: 1.0,
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -315,14 +312,12 @@ class _FullScreenPageState extends State<FullScreenPage> with AfterLayoutMixin {
|
||||
up,
|
||||
style: statusTextStyle,
|
||||
textAlign: TextAlign.center,
|
||||
textScaleFactor: 1.0,
|
||||
),
|
||||
const SizedBox(height: 3),
|
||||
Text(
|
||||
down,
|
||||
style: statusTextStyle,
|
||||
textAlign: TextAlign.center,
|
||||
textScaleFactor: 1.0,
|
||||
)
|
||||
],
|
||||
),
|
||||
@@ -352,7 +347,6 @@ class _FullScreenPageState extends State<FullScreenPage> with AfterLayoutMixin {
|
||||
'${percent.toStringAsFixed(1)}%',
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(fontSize: 15),
|
||||
textScaleFactor: 1.0,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -353,7 +353,7 @@ class _SSHPageState extends State<SSHPage> with AutomaticKeepAliveClientMixin {
|
||||
_terminal.buffer.setCursor(0, 0);
|
||||
|
||||
_terminal.onOutput = (data) {
|
||||
session.write(utf8.encode(data) as Uint8List);
|
||||
session.write(utf8.encode(data));
|
||||
};
|
||||
_terminal.onResize = (width, height, pixelWidth, pixelHeight) {
|
||||
session.resizeTerminal(width, height);
|
||||
|
||||
@@ -78,7 +78,7 @@ class _LocalStoragePageState extends State<LocalStoragePage> {
|
||||
),
|
||||
body: FadeIn(
|
||||
key: UniqueKey(),
|
||||
child: _wrapPopScope(),
|
||||
child: _buildBody(),
|
||||
),
|
||||
bottomNavigationBar: SafeArea(child: _buildPath()),
|
||||
);
|
||||
@@ -122,21 +122,6 @@ class _LocalStoragePageState extends State<LocalStoragePage> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _wrapPopScope() {
|
||||
return WillPopScope(
|
||||
onWillPop: () async {
|
||||
if (_path == null) return true;
|
||||
if (_path!.canBack) {
|
||||
_path!.update('..');
|
||||
setState(() {});
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
child: _buildBody(),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildBody() {
|
||||
if (_path == null) {
|
||||
return const Center(
|
||||
|
||||
@@ -69,24 +69,11 @@ class _SftpPageState extends State<SftpPage> with AfterLayoutMixin {
|
||||
),
|
||||
],
|
||||
),
|
||||
body: _buildBody(),
|
||||
body: _buildFileView(),
|
||||
bottomNavigationBar: _buildBottom(),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildBody() {
|
||||
return WillPopScope(
|
||||
onWillPop: () async {
|
||||
if (_status.path == null || _status.path?.path == '/') {
|
||||
return true;
|
||||
}
|
||||
await _backward();
|
||||
return false;
|
||||
},
|
||||
child: _buildFileView(),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildBottom() {
|
||||
final children = widget.isSelect
|
||||
? [
|
||||
|
||||
Reference in New Issue
Block a user