mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 07:14:28 +01:00
opt.: home ui
- new: top left settings btn - opt.: top logo
This commit is contained in:
@@ -2,7 +2,7 @@ import 'package:fl_lib/fl_lib.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:server_box/core/extension/context/locale.dart';
|
||||
import 'package:server_box/view/page/server/tab.dart';
|
||||
import 'package:server_box/view/page/setting/entry.dart';
|
||||
// import 'package:server_box/view/page/setting/entry.dart';
|
||||
import 'package:server_box/view/page/snippet/list.dart';
|
||||
import 'package:server_box/view/page/ssh/tab.dart';
|
||||
import 'package:icons_plus/icons_plus.dart';
|
||||
@@ -13,13 +13,13 @@ enum AppTab {
|
||||
ssh,
|
||||
file,
|
||||
snippet,
|
||||
settings,
|
||||
//settings,
|
||||
;
|
||||
|
||||
Widget get page {
|
||||
return switch (this) {
|
||||
server => const ServerPage(),
|
||||
settings => const SettingsPage(),
|
||||
//settings => const SettingsPage(),
|
||||
ssh => const SSHTabPage(),
|
||||
file => const LocalFilePage(),
|
||||
snippet => const SnippetListPage(),
|
||||
@@ -33,11 +33,11 @@ enum AppTab {
|
||||
label: l10n.server,
|
||||
selectedIcon: const Icon(BoxIcons.bxs_server),
|
||||
),
|
||||
settings => NavigationDestination(
|
||||
icon: const Icon(Icons.settings),
|
||||
label: libL10n.setting,
|
||||
selectedIcon: const Icon(Icons.settings),
|
||||
),
|
||||
// settings => NavigationDestination(
|
||||
// icon: const Icon(Icons.settings),
|
||||
// label: libL10n.setting,
|
||||
// selectedIcon: const Icon(Icons.settings),
|
||||
// ),
|
||||
ssh => const NavigationDestination(
|
||||
icon: Icon(Icons.terminal_outlined),
|
||||
label: 'SSH',
|
||||
|
||||
@@ -9,9 +9,26 @@ final class _AppBar extends StatelessWidget implements PreferredSizeWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return SizedBox(
|
||||
height: preferredSize.height,
|
||||
child: isIOS
|
||||
? const Center(child: Text(BuildData.name, style: UIs.text15Bold))
|
||||
: null,
|
||||
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,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -25,16 +25,17 @@ final class _TopBar extends StatelessWidget implements PreferredSizeWidget {
|
||||
context,
|
||||
args: const DebugPageArgs(title: 'Logs(${BuildData.build})'),
|
||||
),
|
||||
child: const Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 7),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 7),
|
||||
child: Row(
|
||||
children: [
|
||||
Text(
|
||||
BuildData.name,
|
||||
style: TextStyle(fontSize: 20),
|
||||
textAlign: TextAlign.center,
|
||||
Btn.icon(
|
||||
icon: const Icon(Icons.settings),
|
||||
onTap: () {
|
||||
SettingsPage.route.go(context);
|
||||
},
|
||||
),
|
||||
Icon(
|
||||
const Icon(
|
||||
Icons.keyboard_arrow_right,
|
||||
color: Colors.grey,
|
||||
size: 17,
|
||||
|
||||
@@ -70,7 +70,9 @@ class _SettingsPageState extends State<SettingsPage>
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: TabBar(
|
||||
appBar: AppBar(
|
||||
title: Text(libL10n.setting, style: const TextStyle(fontSize: 20)),
|
||||
bottom: TabBar(
|
||||
controller: _tabCtrl,
|
||||
dividerHeight: 0,
|
||||
tabAlignment: TabAlignment.center,
|
||||
@@ -79,6 +81,7 @@ class _SettingsPageState extends State<SettingsPage>
|
||||
.map((e) => Tab(text: e.i18n))
|
||||
.toList(growable: false),
|
||||
),
|
||||
),
|
||||
// actions: [
|
||||
// IconButton(
|
||||
// icon: const Icon(Icons.delete),
|
||||
@@ -134,8 +137,9 @@ final class _AppAboutPageState extends State<AppAboutPage>
|
||||
),
|
||||
UIs.height13,
|
||||
SizedBox(
|
||||
height: 47,
|
||||
height: 77,
|
||||
child: ListView(
|
||||
padding: const EdgeInsets.symmetric(vertical: 13, horizontal: 7),
|
||||
scrollDirection: Axis.horizontal,
|
||||
children: <Widget>[
|
||||
Btn.elevated(
|
||||
|
||||
@@ -478,8 +478,8 @@ packages:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
path: "."
|
||||
ref: "v1.0.217"
|
||||
resolved-ref: a07b1d2a004574b3d083f87a295a428286524ef7
|
||||
ref: "v1.0.218"
|
||||
resolved-ref: b8108c9ffe1e67da22e8f9003e0adfe2692f3b0b
|
||||
url: "https://github.com/lppcg/fl_lib"
|
||||
source: git
|
||||
version: "0.0.1"
|
||||
|
||||
@@ -60,7 +60,7 @@ dependencies:
|
||||
fl_lib:
|
||||
git:
|
||||
url: https://github.com/lppcg/fl_lib
|
||||
ref: v1.0.217
|
||||
ref: v1.0.218
|
||||
|
||||
dependency_overrides:
|
||||
# dartssh2:
|
||||
|
||||
Reference in New Issue
Block a user