opt.: use json_serializable

This commit is contained in:
lollipopkit🏳️‍⚧️
2024-08-15 16:44:13 +08:00
parent 195ddd2bcc
commit 7ce3854392
18 changed files with 221 additions and 196 deletions

View File

@@ -711,7 +711,12 @@ class _ServerDetailPageState extends State<ServerDetailPage>
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(key, style: UIs.text15),
Text(key, style: UIs.text15).paddingSymmetric(horizontal: 5).tap(
onTap: () {
Pfs.copy(key);
context.showSnackBar('${libL10n.copy} ${libL10n.success}');
},
),
Text('${val?.toStringAsFixed(1)}°C', style: UIs.text13Grey),
],
),

View File

@@ -38,11 +38,11 @@ final class _SystemdPageState extends State<SystemdPage> {
return Scaffold(
appBar: CustomAppBar(
title: const Text('Systemd'),
actions: [
Btn.icon(icon: const Icon(Icons.refresh), onTap: _pro.getUnits),
],
actions: isDesktop
? [Btn.icon(icon: const Icon(Icons.refresh), onTap: _pro.getUnits)]
: null,
),
body: _buildBody(),
body: RefreshIndicator(onRefresh: _pro.getUnits, child: _buildBody()),
);
}
@@ -71,8 +71,8 @@ final class _SystemdPageState extends State<SystemdPage> {
(units) {
if (units.isEmpty) {
return SliverToBoxAdapter(
child: CenterGreyTitle(libL10n.empty)
.paddingSymmetric(horizontal: 13),
child:
CenterGreyTitle(libL10n.empty).paddingSymmetric(horizontal: 13),
);
}
return SliverList(
@@ -155,10 +155,8 @@ final class _SystemdPageState extends State<SystemdPage> {
color: color?.withOpacity(0.7) ?? UIs.halfAlpha,
borderRadius: BorderRadius.circular(5),
),
child: Text(
tag,
style: UIs.text11Grey,
).paddingSymmetric(horizontal: 5, vertical: 1),
child: Text(tag, style: UIs.text11)
.paddingSymmetric(horizontal: 5, vertical: 1),
).paddingOnly(right: noPad ? 0 : 5);
}
}