Center title in SFTP/Apt

This commit is contained in:
Junyuan Feng
2022-03-08 18:07:52 +08:00
parent 7a5516792c
commit e6e08dc407
8 changed files with 38 additions and 22 deletions

View File

@@ -2,9 +2,9 @@
class BuildData {
static const String name = "ServerBox";
static const int build = 102;
static const int build = 106;
static const String engine =
"Flutter 2.10.3 • channel stable • https://github.com/flutter/flutter.git\nFramework • revision 7e9793dee1 (5 days ago) • 2022-03-02 11:23:12 -0600\nEngine • revision bd539267b4\nTools • Dart 2.16.1 • DevTools 2.9.2\n";
static const String buildAt = "2022-03-07 19:19:07.115966";
static const int modifications = 18;
"Flutter 2.10.3 • channel stable • https://github.com/flutter/flutter.git\nFramework • revision 7e9793dee1 (6 days ago) • 2022-03-02 11:23:12 -0600\nEngine • revision bd539267b4\nTools • Dart 2.16.1 • DevTools 2.9.2\n";
static const String buildAt = "2022-03-08 18:06:40.014600";
static const int modifications = 8;
}

View File

@@ -54,6 +54,7 @@ class _AptManagePageState extends State<AptManagePage>
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
centerTitle: true,
title: TwoLineText(up: 'Apt', down: widget.spi.ip),
actions: [
IconButton(

View File

@@ -57,6 +57,7 @@ class _DockerManagePageState extends State<DockerManagePage> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
centerTitle: true,
title: TwoLineText(up: 'Docker', down: widget.spi.ip),
),
body: _buildMain(),
@@ -125,7 +126,9 @@ class _DockerManagePageState extends State<DockerManagePage> {
return ListTile(
title: Text(item.image),
subtitle: Text(item.status),
trailing: docker.isBusy ? const CircularProgressIndicator() : _buildMoreBtn(item.running, item.containerId),
trailing: docker.isBusy
? const CircularProgressIndicator()
: _buildMoreBtn(item.running, item.containerId),
);
}).toList(),
);

View File

@@ -195,8 +195,8 @@ class _SFTPPageState extends State<SFTPPage> {
]);
return;
}
_status.client!.mkdir(
_status.path!.path + '/' + textController.text);
_status.client!
.mkdir(_status.path!.path + '/' + textController.text);
Navigator.of(context).pop();
listDir();
},
@@ -234,8 +234,7 @@ class _SFTPPageState extends State<SFTPPage> {
]);
return;
}
await _status
.client!
await _status.client!
.rename(file.filename, textController.text);
Navigator.of(context).pop();
listDir();
@@ -270,9 +269,8 @@ class _SFTPPageState extends State<SFTPPage> {
final sftpc = await client.sftp();
_status.client = sftpc;
}
final fs = await _status
.client!
.listdir(path ?? (_status.path?.path ?? '/'));
final fs =
await _status.client!.listdir(path ?? (_status.path?.path ?? '/'));
fs.sort((a, b) => a.filename.compareTo(b.filename));
fs.removeAt(0);
if (mounted) {

View File

@@ -1,7 +1,8 @@
import 'package:flutter/material.dart';
class TwoLineText extends StatelessWidget {
const TwoLineText({Key? key, required this.up, required this.down}) : super(key: key);
const TwoLineText({Key? key, required this.up, required this.down})
: super(key: key);
final String up;
final String down;
@@ -9,8 +10,14 @@ class TwoLineText extends StatelessWidget {
Widget build(BuildContext context) {
return Column(
children: [
Text(up, style: const TextStyle(fontSize: 15),),
Text(down, style: const TextStyle(fontSize: 11),)
Text(
up,
style: const TextStyle(fontSize: 15),
),
Text(
down,
style: const TextStyle(fontSize: 11),
)
],
);
}

View File

@@ -335,6 +335,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.11"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.3"
meta:
dependency: transitive
description:
@@ -521,7 +528,7 @@ packages:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.3"
version: "0.4.8"
typed_data:
dependency: transitive
description: