opt.: home top bar

This commit is contained in:
lollipopkit
2024-12-14 14:11:26 +08:00
parent 029b4e0dba
commit 41886be649
4 changed files with 45 additions and 38 deletions

View File

@@ -21,21 +21,19 @@ final class _TopBar extends StatelessWidget implements PreferredSizeWidget {
Center( Center(
child: InkWell( child: InkWell(
borderRadius: BorderRadius.circular(13), borderRadius: BorderRadius.circular(13),
onTap: () => DebugPage.route.go(
context,
args: const DebugPageArgs(title: 'Logs(${BuildData.build})'),
),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 7),
child: Row(
children: [
Btn.icon(
icon: const Icon(Icons.settings),
onTap: () { onTap: () {
SettingsPage.route.go(context); SettingsPage.route.go(context);
}, },
child: const Padding(
padding: EdgeInsets.symmetric(horizontal: 7, vertical: 3),
child: Row(
children: [
Text(
BuildData.name,
style: TextStyle(fontSize: 19),
), ),
const Icon( SizedBox(width: 3),
Icon(
Icons.keyboard_arrow_right, Icons.keyboard_arrow_right,
color: Colors.grey, color: Colors.grey,
size: 17, size: 17,

View File

@@ -4,6 +4,7 @@ import 'dart:io';
import 'package:fl_lib/fl_lib.dart'; import 'package:fl_lib/fl_lib.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_highlight/theme_map.dart'; import 'package:flutter_highlight/theme_map.dart';
import 'package:server_box/data/store/setting.dart';
import 'package:server_box/generated/l10n/l10n.dart'; import 'package:server_box/generated/l10n/l10n.dart';
import 'package:icons_plus/icons_plus.dart'; import 'package:icons_plus/icons_plus.dart';
@@ -81,30 +82,38 @@ class _SettingsPageState extends State<SettingsPage>
.map((e) => Tab(text: e.i18n)) .map((e) => Tab(text: e.i18n))
.toList(growable: false), .toList(growable: false),
), ),
actions: [
Btn.icon(
icon: const Icon(Icons.developer_board),
onTap: () => DebugPage.route.go(
context,
args: const DebugPageArgs(title: 'Logs(${BuildData.build})'),
),
),
Btn.icon(
icon: const Icon(Icons.delete),
onTap: () => context.showRoundDialog(
title: libL10n.attention,
child: SimpleMarkdown(
data: libL10n.askContinue(
'${libL10n.delete} **${libL10n.all}** ${libL10n.setting}',
),
),
actions: [
CountDownBtn(
onTap: () {
context.pop();
final keys = SettingStore.instance.box.keys;
SettingStore.instance.box.deleteAll(keys);
context.showSnackBar(libL10n.success);
},
afterColor: Colors.red,
)
],
),
),
],
), ),
// actions: [
// IconButton(
// icon: const Icon(Icons.delete),
// onPressed: () => context.showRoundDialog(
// title: libL10n.attention,
// child: SimpleMarkdown(
// data: libL10n.askContinue(
// '${libL10n.delete} **${libL10n.all}** ${libL10n.setting}',
// ),
// ),
// actions: [
// CountDownBtn(
// onTap: () {
// context.pop();
// _setting.box.deleteAll(_setting.box.keys);
// context.showSnackBar(libL10n.success);
// },
// afterColor: Colors.red,
// )
// ],
// ),
// ),
// ],
body: TabBarView(controller: _tabCtrl, children: SettingsTabs.pages), body: TabBarView(controller: _tabCtrl, children: SettingsTabs.pages),
); );
} }

View File

@@ -478,8 +478,8 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
path: "." path: "."
ref: "v1.0.219" ref: "v1.0.221"
resolved-ref: "1b52e9179ded8e0e90d9419a4e6d47c0ef4d1dd0" resolved-ref: a0dc0032eaafb596a7886fca1237f404b2c1b1a8
url: "https://github.com/lppcg/fl_lib" url: "https://github.com/lppcg/fl_lib"
source: git source: git
version: "0.0.1" version: "0.0.1"

View File

@@ -60,7 +60,7 @@ dependencies:
fl_lib: fl_lib:
git: git:
url: https://github.com/lppcg/fl_lib url: https://github.com/lppcg/fl_lib
ref: v1.0.219 ref: v1.0.221
dependency_overrides: dependency_overrides:
# dartssh2: # dartssh2: