Merge remote-tracking branch 'origin/lollipopkit/issue727'

This commit is contained in:
lollipopkit🏳️‍⚧️
2025-04-25 18:33:36 +08:00
26 changed files with 62 additions and 82 deletions

View File

@@ -117,7 +117,7 @@ class _EditorPageState extends State<EditorPage> {
}
PreferredSizeWidget _buildAppBar() {
return AppBar(
return CustomAppBar(
centerTitle: true,
title: TwoLineText(
up: widget.args?.title ??

View File

@@ -9,26 +9,6 @@ final class _AppBar extends StatelessWidget implements PreferredSizeWidget {
Widget build(BuildContext context) {
return SizedBox(
height: preferredSize.height,
child: isIOS ? Center(child: _buildLogo()) : null,
);
}
Widget _buildLogo() {
final text = Text(
BuildData.name,
style: TextStyle(
fontSize: 10,
fontWeight: FontWeight.bold,
color: UIs.primaryColor.isBrightColor ? Colors.black : Colors.white,
),
);
return Container(
decoration: BoxDecoration(
color: UIs.primaryColor,
borderRadius: BorderRadius.circular(11),
),
padding: const EdgeInsets.symmetric(horizontal: 5, vertical: 1),
child: text,
);
}

View File

@@ -38,7 +38,7 @@ class _IPerfPageState extends State<IPerfPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
appBar: CustomAppBar(
title: const Text('iperf'),
),
body: _buildBody(),

View File

@@ -78,7 +78,7 @@ class _PrivateKeyEditPageState extends State<PrivateKeyEditPage> {
);
}
AppBar _buildAppBar() {
CustomAppBar _buildAppBar() {
final actions = [
IconButton(
tooltip: libL10n.delete,
@@ -101,7 +101,7 @@ class _PrivateKeyEditPageState extends State<PrivateKeyEditPage> {
icon: const Icon(Icons.delete),
)
];
return AppBar(
return CustomAppBar(
title: Text(libL10n.edit),
actions: widget.pki == null ? null : actions,
);

View File

@@ -123,7 +123,7 @@ class _ProcessPageState extends State<ProcessPage> {
);
}
return Scaffold(
appBar: AppBar(
appBar: CustomAppBar(
centerTitle: true,
title: TwoLineText(up: widget.spi.name, down: l10n.process),
actions: actions,

View File

@@ -60,7 +60,7 @@ final class _PvePageState extends State<PvePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
appBar: CustomAppBar(
title: TwoLineText(up: 'PVE', down: widget.args.spi.name),
actions: [
ValBuilder(

View File

@@ -86,7 +86,7 @@ class _ServerDetailPageState extends State<ServerDetailPage>
final s = widget.spi.server;
if (s == null) {
return Scaffold(
appBar: AppBar(),
appBar: CustomAppBar(),
body: Center(child: Text(libL10n.empty)),
);
}
@@ -119,8 +119,8 @@ class _ServerDetailPageState extends State<ServerDetailPage>
);
}
AppBar _buildAppBar(Server si) {
return AppBar(
CustomAppBar _buildAppBar(Server si) {
return CustomAppBar(
title: Hero(
tag: 'home_card_title_${si.spi.id}',
transitionOnUserGestures: true,

View File

@@ -110,7 +110,7 @@ class _ServerEditPageState extends State<ServerEditPage> with AfterLayoutMixin {
return GestureDetector(
onTap: () => _focusScope.unfocus(),
child: Scaffold(
appBar: AppBar(title: Text(libL10n.edit), actions: actions),
appBar: CustomAppBar(title: Text(libL10n.edit), actions: actions),
body: _buildForm(),
floatingActionButton: _buildFAB(),
),

View File

@@ -17,7 +17,7 @@ class _AndroidSettingsPageState extends State<AndroidSettingsPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('Android')),
appBar: CustomAppBar(title: const Text('Android')),
body: ListView(
padding: const EdgeInsets.symmetric(horizontal: 17),
children: [

View File

@@ -27,7 +27,7 @@ class _IOSSettingsPageState extends State<IOSSettingsPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('iOS')),
appBar: CustomAppBar(title: const Text('iOS')),
body: ListView(
padding: const EdgeInsets.symmetric(horizontal: 17),
children: [

View File

@@ -19,8 +19,8 @@ abstract final class PlatformPublicSettings {
title: Text(libL10n.bioAuth),
subtitle: can == true
? null
: const Text(
'Not available',
: Text(
libL10n.notExistFmt(libL10n.bioAuth),
style: UIs.textGrey,
),
trailing: can == true

View File

@@ -17,7 +17,7 @@ class _ServerDetailOrderPageState extends State<ServerDetailOrderPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text(l10n.serverDetailOrder)),
appBar: CustomAppBar(title: Text(l10n.serverDetailOrder)),
body: _buildBody(),
);
}

View File

@@ -19,7 +19,7 @@ class _ServerDetailOrderPageState extends State<ServerFuncBtnsOrderPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text(l10n.sequence)),
appBar: CustomAppBar(title: Text(l10n.sequence)),
body: _buildBody(),
);
}

View File

@@ -16,7 +16,7 @@ class _ServerOrderPageState extends State<ServerOrderPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text(l10n.serverOrder)),
appBar: CustomAppBar(title: Text(l10n.serverOrder)),
body: _buildBody(),
);
}

View File

@@ -17,7 +17,7 @@ class _SSHVirtKeySettingPageState extends State<SSHVirtKeySettingPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text(l10n.editVirtKeys)),
appBar: CustomAppBar(title: Text(l10n.editVirtKeys)),
body: Column(
children: [
Padding(

View File

@@ -38,7 +38,7 @@ class _SnippetEditPageState extends State<SnippetEditPage>
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
appBar: CustomAppBar(
title: Text(libL10n.edit),
actions: _buildAppBarActions(),
),

View File

@@ -11,7 +11,7 @@ class SnippetResultPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text(l10n.result)),
appBar: CustomAppBar(title: Text(l10n.result)),
body: _buildBody(),
);
}

View File

@@ -53,7 +53,7 @@ class _LocalFilePageState extends State<LocalFilePage>
super.build(context);
final title = _path.path.fileNameGetter ?? libL10n.file;
return Scaffold(
appBar: AppBar(
appBar: CustomAppBar(
title: AnimatedSwitcher(
duration: Durations.short3,
child: Text(title, key: ValueKey(title)),

View File

@@ -62,7 +62,7 @@ class _SftpPageState extends State<SftpPage> with AfterLayoutMixin {
if (isDesktop) children.add(_buildRefreshBtn());
return Scaffold(
appBar: AppBar(
appBar: CustomAppBar(
title: TwoLineText(up: 'SFTP', down: widget.spi.name),
actions: children,
),

View File

@@ -16,7 +16,7 @@ class _SftpMissionPageState extends State<SftpMissionPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
appBar: CustomAppBar(
title: Text(l10n.mission, style: UIs.text18),
),
body: _buildBody(),

View File

@@ -42,7 +42,7 @@ final class _SystemdPageState extends State<SystemdPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
appBar: CustomAppBar(
title: const Text('Systemd'),
actions: isDesktop
? [Btn.icon(icon: const Icon(Icons.refresh), onTap: _pro.getUnits)]