|
|
@ -4,8 +4,7 @@ import 'package:flutter/material.dart';
|
|
|
|
import 'package:jade_gui/classes/partition.dart';
|
|
|
|
import 'package:jade_gui/classes/partition.dart';
|
|
|
|
|
|
|
|
|
|
|
|
Widget partitionTemplate(partition, runningInfo, setRunningInfo, mountpoints,
|
|
|
|
Widget partitionTemplate(partition, runningInfo, setRunningInfo, mountpoints,
|
|
|
|
setPartitionMountpoint) {
|
|
|
|
setPartitionMountpoint, filesystems, setFilesystem) {
|
|
|
|
String mount = "none";
|
|
|
|
|
|
|
|
if (partition().partition != "") {
|
|
|
|
if (partition().partition != "") {
|
|
|
|
return Column(
|
|
|
|
return Column(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
|
@ -33,6 +32,7 @@ Widget partitionTemplate(partition, runningInfo, setRunningInfo, mountpoints,
|
|
|
|
icon: const Icon(Icons.arrow_downward),
|
|
|
|
icon: const Icon(Icons.arrow_downward),
|
|
|
|
elevation: 16,
|
|
|
|
elevation: 16,
|
|
|
|
style: const TextStyle(color: Colors.deepPurple),
|
|
|
|
style: const TextStyle(color: Colors.deepPurple),
|
|
|
|
|
|
|
|
dropdownColor: const Color.fromARGB(255, 23, 23, 23),
|
|
|
|
underline: Container(
|
|
|
|
underline: Container(
|
|
|
|
height: 2,
|
|
|
|
height: 2,
|
|
|
|
color: Colors.deepPurpleAccent,
|
|
|
|
color: Colors.deepPurpleAccent,
|
|
|
@ -40,14 +40,39 @@ Widget partitionTemplate(partition, runningInfo, setRunningInfo, mountpoints,
|
|
|
|
onChanged: (String? newValue) {
|
|
|
|
onChanged: (String? newValue) {
|
|
|
|
setPartitionMountpoint(
|
|
|
|
setPartitionMountpoint(
|
|
|
|
partition(), newValue == "" ? "none" : newValue);
|
|
|
|
partition(), newValue == "" ? "none" : newValue);
|
|
|
|
mount = newValue == "" ? "none" : newValue!;
|
|
|
|
|
|
|
|
print(partition().mountpoint);
|
|
|
|
print(partition().mountpoint);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
items:
|
|
|
|
items:
|
|
|
|
mountpoints.map<DropdownMenuItem<String>>((String value) {
|
|
|
|
mountpoints.map<DropdownMenuItem<String>>((String value) {
|
|
|
|
return DropdownMenuItem<String>(
|
|
|
|
return DropdownMenuItem<String>(
|
|
|
|
value: value,
|
|
|
|
value: value,
|
|
|
|
child: Text(value),
|
|
|
|
child: Text(value,
|
|
|
|
|
|
|
|
style: const TextStyle(color: Colors.white)),
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}).toList(),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
const SizedBox(width: 10),
|
|
|
|
|
|
|
|
DropdownButton<String>(
|
|
|
|
|
|
|
|
value: partition().filesystem,
|
|
|
|
|
|
|
|
icon: const Icon(Icons.arrow_downward),
|
|
|
|
|
|
|
|
elevation: 16,
|
|
|
|
|
|
|
|
style: const TextStyle(color: Colors.deepPurple),
|
|
|
|
|
|
|
|
dropdownColor: const Color.fromARGB(255, 23, 23, 23),
|
|
|
|
|
|
|
|
underline: Container(
|
|
|
|
|
|
|
|
height: 2,
|
|
|
|
|
|
|
|
color: Colors.deepPurpleAccent,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
onChanged: (String? newValue) {
|
|
|
|
|
|
|
|
setFilesystem(
|
|
|
|
|
|
|
|
partition(), newValue == "" ? "none" : newValue);
|
|
|
|
|
|
|
|
print(partition().filesystem);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
items:
|
|
|
|
|
|
|
|
filesystems.map<DropdownMenuItem<String>>((String value) {
|
|
|
|
|
|
|
|
return DropdownMenuItem<String>(
|
|
|
|
|
|
|
|
value: value,
|
|
|
|
|
|
|
|
child: Text(value,
|
|
|
|
|
|
|
|
style: const TextStyle(color: Colors.white)),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}).toList(),
|
|
|
|
}).toList(),
|
|
|
|
),
|
|
|
|
),
|
|
|
@ -61,8 +86,20 @@ Widget partitionTemplate(partition, runningInfo, setRunningInfo, mountpoints,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Widget manualPartitioning(partitions, setState, runningPart, setRunningPart,
|
|
|
|
/*mkfs.bfs mkfs.cramfs mkfs.ext3 mkfs.fat mkfs.msdos mkfs.xfs
|
|
|
|
runningInfo, setRunningInfo, setPartitionMountpoint, setManual, next) {
|
|
|
|
mkfs.btrfs mkfs.ext2 mkfs.ext4 mkfs.minix mkfs.vfat */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Widget manualPartitioning(
|
|
|
|
|
|
|
|
partitions,
|
|
|
|
|
|
|
|
setState,
|
|
|
|
|
|
|
|
runningPart,
|
|
|
|
|
|
|
|
setRunningPart,
|
|
|
|
|
|
|
|
runningInfo,
|
|
|
|
|
|
|
|
setRunningInfo,
|
|
|
|
|
|
|
|
setPartitionMountpoint,
|
|
|
|
|
|
|
|
setManual,
|
|
|
|
|
|
|
|
next,
|
|
|
|
|
|
|
|
setFilesystem) {
|
|
|
|
var mountpoints = <String>[
|
|
|
|
var mountpoints = <String>[
|
|
|
|
"none",
|
|
|
|
"none",
|
|
|
|
"/",
|
|
|
|
"/",
|
|
|
@ -74,6 +111,20 @@ Widget manualPartitioning(partitions, setState, runningPart, setRunningPart,
|
|
|
|
"/usr",
|
|
|
|
"/usr",
|
|
|
|
"/var"
|
|
|
|
"/var"
|
|
|
|
];
|
|
|
|
];
|
|
|
|
|
|
|
|
var filesystems = <String>[
|
|
|
|
|
|
|
|
"don't format",
|
|
|
|
|
|
|
|
"bfs",
|
|
|
|
|
|
|
|
"cramfs",
|
|
|
|
|
|
|
|
"ext3",
|
|
|
|
|
|
|
|
"fat",
|
|
|
|
|
|
|
|
"msdos",
|
|
|
|
|
|
|
|
"xfs",
|
|
|
|
|
|
|
|
"btrfs",
|
|
|
|
|
|
|
|
"ext2",
|
|
|
|
|
|
|
|
"ext4",
|
|
|
|
|
|
|
|
"minix",
|
|
|
|
|
|
|
|
"vfat"
|
|
|
|
|
|
|
|
];
|
|
|
|
return Column(
|
|
|
|
return Column(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
@ -118,6 +169,8 @@ Widget manualPartitioning(partitions, setState, runningPart, setRunningPart,
|
|
|
|
setRunningInfo,
|
|
|
|
setRunningInfo,
|
|
|
|
mountpoints,
|
|
|
|
mountpoints,
|
|
|
|
setPartitionMountpoint,
|
|
|
|
setPartitionMountpoint,
|
|
|
|
|
|
|
|
filesystems,
|
|
|
|
|
|
|
|
setFilesystem,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
.toList(),
|
|
|
|
.toList(),
|
|
|
@ -146,25 +199,23 @@ Widget manualPartitioning(partitions, setState, runningPart, setRunningPart,
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
const Text(
|
|
|
|
const Text(
|
|
|
|
'Currently chosen Disk: ',
|
|
|
|
'Select partitions',
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 20,
|
|
|
|
fontSize: 20,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
color: Color.fromARGB(255, 169, 0, 255),
|
|
|
|
color: Color.fromARGB(255, 169, 0, 255),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
const SizedBox(height: 10),
|
|
|
|
|
|
|
|
const Text(
|
|
|
|
const Text(
|
|
|
|
"selectedPartition",
|
|
|
|
'to format',
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 20,
|
|
|
|
fontSize: 20,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
color: Color.fromARGB(255, 169, 0, 255),
|
|
|
|
color: Color.fromARGB(255, 169, 0, 255),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
const SizedBox(height: 5),
|
|
|
|
|
|
|
|
const Text(
|
|
|
|
const Text(
|
|
|
|
'Size: diskInfo',
|
|
|
|
'and mount',
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 20,
|
|
|
|
fontSize: 20,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|