|
|
@ -2,9 +2,10 @@ import 'dart:async';
|
|
|
|
import 'dart:io';
|
|
|
|
import 'dart:io';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:jade_gui/classes/partition.dart';
|
|
|
|
import 'package:jade_gui/classes/partition.dart';
|
|
|
|
|
|
|
|
import 'package:jade_gui/functions/partitioning/auto.dart';
|
|
|
|
|
|
|
|
|
|
|
|
Widget partitionTemplate(partition, runningInfo, setRunningInfo, mountpoints,
|
|
|
|
Widget partitionTemplate(partition, runningInfo, setRunningInfo, mountpoints,
|
|
|
|
setPartitionMountpoint, filesystems, setFilesystem) {
|
|
|
|
setPartitionMountpoint, filesystems, setFilesystem, efi) {
|
|
|
|
if (partition().partition != "") {
|
|
|
|
if (partition().partition != "") {
|
|
|
|
return Column(
|
|
|
|
return Column(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
|
@ -99,7 +100,14 @@ Widget manualPartitioning(
|
|
|
|
setPartitionMountpoint,
|
|
|
|
setPartitionMountpoint,
|
|
|
|
setManual,
|
|
|
|
setManual,
|
|
|
|
next,
|
|
|
|
next,
|
|
|
|
setFilesystem) {
|
|
|
|
setFilesystem,
|
|
|
|
|
|
|
|
efi,
|
|
|
|
|
|
|
|
disk,
|
|
|
|
|
|
|
|
disks,
|
|
|
|
|
|
|
|
setDisks,
|
|
|
|
|
|
|
|
runningDisk,
|
|
|
|
|
|
|
|
setRunningDisk,
|
|
|
|
|
|
|
|
setPartition) {
|
|
|
|
var mountpoints = <String>[
|
|
|
|
var mountpoints = <String>[
|
|
|
|
"none",
|
|
|
|
"none",
|
|
|
|
"/",
|
|
|
|
"/",
|
|
|
@ -125,6 +133,7 @@ Widget manualPartitioning(
|
|
|
|
"minix",
|
|
|
|
"minix",
|
|
|
|
"vfat"
|
|
|
|
"vfat"
|
|
|
|
];
|
|
|
|
];
|
|
|
|
|
|
|
|
getDisk(setDisks, runningDisk, setRunningDisk);
|
|
|
|
return Column(
|
|
|
|
return Column(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
@ -159,10 +168,11 @@ Widget manualPartitioning(
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
primary: false,
|
|
|
|
primary: false,
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Column(
|
|
|
|
children: partitions
|
|
|
|
children: partitions
|
|
|
|
.map<Widget>(
|
|
|
|
.map<Widget>(
|
|
|
|
(partition) => partitionTemplate(
|
|
|
|
(partition) => partitionTemplate(() {
|
|
|
|
() {
|
|
|
|
|
|
|
|
return partition;
|
|
|
|
return partition;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
runningInfo,
|
|
|
|
runningInfo,
|
|
|
@ -171,10 +181,12 @@ Widget manualPartitioning(
|
|
|
|
setPartitionMountpoint,
|
|
|
|
setPartitionMountpoint,
|
|
|
|
filesystems,
|
|
|
|
filesystems,
|
|
|
|
setFilesystem,
|
|
|
|
setFilesystem,
|
|
|
|
),
|
|
|
|
efi),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
.toList(),
|
|
|
|
.toList(),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
@ -206,23 +218,56 @@ Widget manualPartitioning(
|
|
|
|
color: Color.fromARGB(255, 169, 0, 255),
|
|
|
|
color: Color.fromARGB(255, 169, 0, 255),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
const Text(
|
|
|
|
Visibility(
|
|
|
|
'to format',
|
|
|
|
visible: efi,
|
|
|
|
|
|
|
|
child: const Text(
|
|
|
|
|
|
|
|
'Bootloader Device:',
|
|
|
|
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 Text(
|
|
|
|
),
|
|
|
|
'and mount',
|
|
|
|
const SizedBox(height: 6),
|
|
|
|
style: TextStyle(
|
|
|
|
Visibility(
|
|
|
|
fontSize: 20,
|
|
|
|
visible: efi,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
child: Container(
|
|
|
|
color: Color.fromARGB(255, 169, 0, 255),
|
|
|
|
padding: const EdgeInsets.fromLTRB(5, 2, 2, 5),
|
|
|
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
|
|
|
borderRadius: BorderRadius.circular(5),
|
|
|
|
|
|
|
|
border: Border.all(color: Colors.black45),
|
|
|
|
|
|
|
|
color: const Color.fromARGB(255, 30, 30, 30),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
child: DropdownButton<String>(
|
|
|
|
|
|
|
|
value: disk,
|
|
|
|
|
|
|
|
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) {
|
|
|
|
|
|
|
|
setPartition(newValue!);
|
|
|
|
|
|
|
|
print(disk);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
items: disks
|
|
|
|
|
|
|
|
.split('\n')
|
|
|
|
|
|
|
|
.map<DropdownMenuItem<String>>((String value) {
|
|
|
|
|
|
|
|
return DropdownMenuItem<String>(
|
|
|
|
|
|
|
|
value: value,
|
|
|
|
|
|
|
|
child: Text(value,
|
|
|
|
|
|
|
|
style:
|
|
|
|
|
|
|
|
const TextStyle(color: Colors.white)),
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}).toList(),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
const SizedBox(height: 5),
|
|
|
|
),
|
|
|
|
|
|
|
|
const SizedBox(height: 10),
|
|
|
|
const Image(image: AssetImage('assets/jade_logo.png')),
|
|
|
|
const Image(image: AssetImage('assets/jade_logo.png')),
|
|
|
|
const SizedBox(height: 10),
|
|
|
|
const SizedBox(height: 10),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|