Redesign net speed part

This commit is contained in:
LollipopKit
2021-11-02 15:29:17 +08:00
parent f0a8941b59
commit ad05b296f6
5 changed files with 24 additions and 7 deletions

View File

@@ -12,7 +12,7 @@ A new Flutter project which provide a chart view to display server status data.
<img width="200px" src="https://raw.githubusercontent.com/LollipopKit/flutter_server_monitor_toolbox/main/screenshots/IMG_3347.PNG"> <img width="200px" src="https://raw.githubusercontent.com/LollipopKit/flutter_server_monitor_toolbox/main/screenshots/IMG_3347.PNG">
</td> </td>
<td> <td>
<img width="200px" src="https://raw.githubusercontent.com/LollipopKit/flutter_server_monitor_toolbox/main/screenshots/IMG_3385.PNG"> <img width="200px" src="https://raw.githubusercontent.com/LollipopKit/flutter_server_monitor_toolbox/main/screenshots/detail.jpg">
</td> </td>
</tr> </tr>
</table> </table>

View File

@@ -2,9 +2,8 @@
class BuildData { class BuildData {
static const String name = "ToolBox"; static const String name = "ToolBox";
static const int build = 50; static const int build = 54;
static const String engine = static const String engine = "Flutter 2.5.3 • channel stable • https://github.com/flutter/flutter.git\nFramework • revision 18116933e7 (2 weeks ago) • 2021-10-15 10:46:35 -0700\nEngine • revision d3ea636dc5\nTools • Dart 2.14.4\n";
"Flutter 2.5.3 • channel stable • https://github.com/flutter/flutter.git\nFramework • revision 18116933e7 (2 weeks ago) • 2021-10-15 10:46:35 -0700\nEngine • revision d3ea636dc5\nTools • Dart 2.14.4\n"; static const String buildAt = "2021-11-01 22:19:44.302306";
static const String buildAt = "2021-10-31 22:21:56.798068"; static const int modifications = 0;
static const int modifications = 1;
} }

View File

@@ -23,11 +23,13 @@ class ServerDetailPage extends StatefulWidget {
class _ServerDetailPageState extends State<ServerDetailPage> class _ServerDetailPageState extends State<ServerDetailPage>
with SingleTickerProviderStateMixin { with SingleTickerProviderStateMixin {
late MediaQueryData _media; late MediaQueryData _media;
late ThemeData _theme;
@override @override
void didChangeDependencies() { void didChangeDependencies() {
super.didChangeDependencies(); super.didChangeDependencies();
_media = MediaQuery.of(context); _media = MediaQuery.of(context);
_theme = Theme.of(context);
} }
@override @override
@@ -272,14 +274,30 @@ class _ServerDetailPageState extends State<ServerDetailPage>
} }
Widget _buildNetView(NetSpeed ns) { Widget _buildNetView(NetSpeed ns) {
final children = <Widget>[_buildNetSpeedTop(), const Divider(height: 7,)];
children.addAll(ns.devices.map((e) => _buildNetSpeedItem(ns, e)));
return RoundRectCard(Padding( return RoundRectCard(Padding(
padding: const EdgeInsets.symmetric(vertical: 7), padding: const EdgeInsets.symmetric(vertical: 7),
child: Column( child: Column(
children: ns.devices.map((e) => _buildNetSpeedItem(ns, e)).toList(), children: children,
), ),
)); ));
} }
Widget _buildNetSpeedTop() {
return Padding(
padding: const EdgeInsets.symmetric(vertical: 3),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: const [
Icon(Icons.device_hub, size: 17,),
Icon(Icons.arrow_upward, size: 17),
Icon(Icons.arrow_downward, size: 17)
],
),
);
}
Widget _buildNetSpeedItem(NetSpeed ns, String device) { Widget _buildNetSpeedItem(NetSpeed ns, String device) {
return Padding( return Padding(
padding: const EdgeInsets.symmetric(vertical: 3), padding: const EdgeInsets.symmetric(vertical: 3),

Binary file not shown.

Before

Width:  |  Height:  |  Size: 258 KiB

BIN
screenshots/detail.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 KiB