Raid_Manager/app/lib/utils/disk_info_page.dart
lukas-heiligenbrunner c1d51d31cc fix test
display mountpoints in gui
2022-12-10 13:36:59 +01:00

38 lines
1.4 KiB
Dart

import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:raid_manager/utils/file_formatter.dart';
import '../breadcrumb_page/breadcrumb_controller.dart';
import '../types/disk.dart';
class DiskInfoPage extends StatefulWidget {
const DiskInfoPage({Key? key, required this.disk}) : super(key: key);
final Disk disk;
@override
State<DiskInfoPage> createState() => _DiskInfoPageState();
}
class _DiskInfoPageState extends State<DiskInfoPage> {
@override
Widget build(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text("Name:",style: Theme.of(context).textTheme.labelMedium),
Text(widget.disk.name,style: Theme.of(context).textTheme.labelMedium),
Text("Size:",style: Theme.of(context).textTheme.labelMedium),
Text(widget.disk.size.readableFileSize(),style: Theme.of(context).textTheme.labelMedium),
Text("Mountpoints:",style: Theme.of(context).textTheme.labelMedium),
Text(widget.disk.mountpoints.toString(),style: Theme.of(context).textTheme.labelMedium),
TextButton(
onPressed: () {
Provider.of<BreadCrumbController>(context, listen: false)
.pushPage(const Text("your smart infos..."), "S.M.A.R.T");
},
child: const Text("Click me"))
],
);
}
}