From 41886be649a43ad6245b9b25361ca5843ef4c94b Mon Sep 17 00:00:00 2001 From: lollipopkit <10864310+lollipopkit@users.noreply.github.com> Date: Sat, 14 Dec 2024 14:11:26 +0800 Subject: [PATCH] opt.: home top bar --- lib/view/page/server/top_bar.dart | 22 ++++++------- lib/view/page/setting/entry.dart | 55 ++++++++++++++++++------------- pubspec.lock | 4 +-- pubspec.yaml | 2 +- 4 files changed, 45 insertions(+), 38 deletions(-) diff --git a/lib/view/page/server/top_bar.dart b/lib/view/page/server/top_bar.dart index ef287638..4ac4836f 100644 --- a/lib/view/page/server/top_bar.dart +++ b/lib/view/page/server/top_bar.dart @@ -21,21 +21,19 @@ final class _TopBar extends StatelessWidget implements PreferredSizeWidget { Center( child: InkWell( borderRadius: BorderRadius.circular(13), - onTap: () => DebugPage.route.go( - context, - args: const DebugPageArgs(title: 'Logs(${BuildData.build})'), - ), - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 7), + onTap: () { + SettingsPage.route.go(context); + }, + child: const Padding( + padding: EdgeInsets.symmetric(horizontal: 7, vertical: 3), child: Row( children: [ - Btn.icon( - icon: const Icon(Icons.settings), - onTap: () { - SettingsPage.route.go(context); - }, + Text( + BuildData.name, + style: TextStyle(fontSize: 19), ), - const Icon( + SizedBox(width: 3), + Icon( Icons.keyboard_arrow_right, color: Colors.grey, size: 17, diff --git a/lib/view/page/setting/entry.dart b/lib/view/page/setting/entry.dart index aa3dc5c9..6e0b4fd0 100644 --- a/lib/view/page/setting/entry.dart +++ b/lib/view/page/setting/entry.dart @@ -4,6 +4,7 @@ import 'dart:io'; import 'package:fl_lib/fl_lib.dart'; import 'package:flutter/material.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:icons_plus/icons_plus.dart'; @@ -81,30 +82,38 @@ class _SettingsPageState extends State .map((e) => Tab(text: e.i18n)) .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), ); } diff --git a/pubspec.lock b/pubspec.lock index ee55e4d3..0fe02265 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -478,8 +478,8 @@ packages: dependency: "direct main" description: path: "." - ref: "v1.0.219" - resolved-ref: "1b52e9179ded8e0e90d9419a4e6d47c0ef4d1dd0" + ref: "v1.0.221" + resolved-ref: a0dc0032eaafb596a7886fca1237f404b2c1b1a8 url: "https://github.com/lppcg/fl_lib" source: git version: "0.0.1" diff --git a/pubspec.yaml b/pubspec.yaml index 1033071a..67deb344 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -60,7 +60,7 @@ dependencies: fl_lib: git: url: https://github.com/lppcg/fl_lib - ref: v1.0.219 + ref: v1.0.221 dependency_overrides: # dartssh2: