|
|
|
@ -11,6 +11,7 @@ import 'package:jade_gui/functions/install.dart';
|
|
|
|
|
import 'package:jade_gui/classes/keymap.dart';
|
|
|
|
|
import 'package:jade_gui/classes/desktop.dart';
|
|
|
|
|
import 'package:jade_gui/desktops/desktops.dart';
|
|
|
|
|
import 'package:window_size/window_size.dart';
|
|
|
|
|
|
|
|
|
|
import 'dart:io';
|
|
|
|
|
|
|
|
|
@ -44,6 +45,11 @@ Future<void> writeToLog(String message) async {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void setWindowSize() {
|
|
|
|
|
setWindowMinSize(Size(0, 0));
|
|
|
|
|
setWindowMaxSize(Size(1300, 870));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void main() => runApp(
|
|
|
|
|
const MaterialApp(
|
|
|
|
|
debugShowCheckedModeBanner: false,
|
|
|
|
@ -69,7 +75,7 @@ class Jadegui extends StatefulWidget {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class _JadeguiState extends State<Jadegui> {
|
|
|
|
|
var file = File("jade_log.txt").writeAsString("");
|
|
|
|
|
var file = File('${env["HOME"]}/jade_log.txt').writeAsString("");
|
|
|
|
|
int _selectedIndex = 0;
|
|
|
|
|
bool nextpage = false;
|
|
|
|
|
bool choseLayout = false;
|
|
|
|
@ -101,6 +107,7 @@ class _JadeguiState extends State<Jadegui> {
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
setWindowSize();
|
|
|
|
|
return Scaffold(
|
|
|
|
|
backgroundColor: const Color.fromARGB(255, 23, 23, 23),
|
|
|
|
|
body: Row(
|
|
|
|
@ -287,14 +294,25 @@ class _JadeguiState extends State<Jadegui> {
|
|
|
|
|
|
|
|
|
|
Widget condition() {
|
|
|
|
|
Widget widget;
|
|
|
|
|
|
|
|
|
|
double logicWidth = 1300;
|
|
|
|
|
double logicHeight = 870;
|
|
|
|
|
switch (_selectedIndex) {
|
|
|
|
|
case 0:
|
|
|
|
|
widget = welcome(() {
|
|
|
|
|
widget = SizedBox(
|
|
|
|
|
child: FittedBox(
|
|
|
|
|
fit: BoxFit.contain,
|
|
|
|
|
alignment: Alignment.center,
|
|
|
|
|
child: SizedBox(
|
|
|
|
|
width: logicWidth,
|
|
|
|
|
height: logicHeight,
|
|
|
|
|
child: welcome(() {
|
|
|
|
|
setState(() {
|
|
|
|
|
_selectedIndex = _selectedIndex + 1;
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
break;
|
|
|
|
|
case 1:
|
|
|
|
|
widget = locale(
|
|
|
|
@ -323,7 +341,14 @@ class _JadeguiState extends State<Jadegui> {
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
widget = keyboard(
|
|
|
|
|
widget = SizedBox.expand(
|
|
|
|
|
child: FittedBox(
|
|
|
|
|
fit: BoxFit.contain,
|
|
|
|
|
alignment: Alignment.center,
|
|
|
|
|
child: SizedBox(
|
|
|
|
|
width: logicWidth,
|
|
|
|
|
height: logicHeight,
|
|
|
|
|
child: keyboard(
|
|
|
|
|
() {
|
|
|
|
|
setState(() {
|
|
|
|
|
_selectedIndex = _selectedIndex + 1;
|
|
|
|
@ -344,10 +369,20 @@ class _JadeguiState extends State<Jadegui> {
|
|
|
|
|
(value) {
|
|
|
|
|
writeToLog(value);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
break;
|
|
|
|
|
case 3:
|
|
|
|
|
widget = users(
|
|
|
|
|
widget = SizedBox.expand(
|
|
|
|
|
child: FittedBox(
|
|
|
|
|
fit: BoxFit.contain,
|
|
|
|
|
alignment: Alignment.center,
|
|
|
|
|
child: SizedBox(
|
|
|
|
|
width: logicWidth,
|
|
|
|
|
height: logicHeight,
|
|
|
|
|
child: users(
|
|
|
|
|
(value) {
|
|
|
|
|
setState(() {
|
|
|
|
|
enableSudo = value;
|
|
|
|
@ -407,11 +442,20 @@ class _JadeguiState extends State<Jadegui> {
|
|
|
|
|
_selectedIndex = _selectedIndex + 1;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
break;
|
|
|
|
|
case 4:
|
|
|
|
|
debugPrint(password);
|
|
|
|
|
widget = desktopView(
|
|
|
|
|
widget = SizedBox.expand(
|
|
|
|
|
child: FittedBox(
|
|
|
|
|
fit: BoxFit.contain,
|
|
|
|
|
alignment: Alignment.center,
|
|
|
|
|
child: SizedBox(
|
|
|
|
|
width: logicWidth,
|
|
|
|
|
height: logicHeight,
|
|
|
|
|
child: desktopView(
|
|
|
|
|
currDesktop,
|
|
|
|
|
(selectedDesktop) {
|
|
|
|
|
setState(() {
|
|
|
|
@ -424,10 +468,20 @@ class _JadeguiState extends State<Jadegui> {
|
|
|
|
|
_selectedIndex = _selectedIndex + 1;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
break;
|
|
|
|
|
case 5:
|
|
|
|
|
widget = misc(
|
|
|
|
|
widget = SizedBox.expand(
|
|
|
|
|
child: FittedBox(
|
|
|
|
|
fit: BoxFit.contain,
|
|
|
|
|
alignment: Alignment.center,
|
|
|
|
|
child: SizedBox(
|
|
|
|
|
width: logicWidth,
|
|
|
|
|
height: logicHeight,
|
|
|
|
|
child: misc(
|
|
|
|
|
(value) {
|
|
|
|
|
setState(() {
|
|
|
|
|
ipv6 = value;
|
|
|
|
@ -454,15 +508,25 @@ class _JadeguiState extends State<Jadegui> {
|
|
|
|
|
_selectedIndex = _selectedIndex + 1;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
break;
|
|
|
|
|
case 6:
|
|
|
|
|
widget = partitioning(
|
|
|
|
|
widget = SizedBox.expand(
|
|
|
|
|
child: FittedBox(
|
|
|
|
|
fit: BoxFit.contain,
|
|
|
|
|
alignment: Alignment.center,
|
|
|
|
|
child: SizedBox(
|
|
|
|
|
width: logicWidth,
|
|
|
|
|
height: logicHeight,
|
|
|
|
|
child: partitioning(
|
|
|
|
|
disks,
|
|
|
|
|
(value) {
|
|
|
|
|
setState(() {
|
|
|
|
|
disks = value;
|
|
|
|
|
writeToLog("Disks: $disks");
|
|
|
|
|
writeToLog("Disks:widget $disks");
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
(value) {
|
|
|
|
@ -496,6 +560,9 @@ class _JadeguiState extends State<Jadegui> {
|
|
|
|
|
runningInfo = true;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
break;
|
|
|
|
|
case 7:
|
|
|
|
@ -512,7 +579,14 @@ class _JadeguiState extends State<Jadegui> {
|
|
|
|
|
runningEfi = true;
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
widget = summary(
|
|
|
|
|
widget = SizedBox.expand(
|
|
|
|
|
child: FittedBox(
|
|
|
|
|
fit: BoxFit.contain,
|
|
|
|
|
alignment: Alignment.center,
|
|
|
|
|
child: SizedBox(
|
|
|
|
|
width: logicWidth,
|
|
|
|
|
height: logicHeight,
|
|
|
|
|
child: summary(
|
|
|
|
|
getSelectedLocPack(),
|
|
|
|
|
getChosenLayout(),
|
|
|
|
|
getChosenVariant(),
|
|
|
|
@ -545,10 +619,20 @@ class _JadeguiState extends State<Jadegui> {
|
|
|
|
|
runningSum = true;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
break;
|
|
|
|
|
case 8:
|
|
|
|
|
widget = install(
|
|
|
|
|
widget = SizedBox.expand(
|
|
|
|
|
child: FittedBox(
|
|
|
|
|
fit: BoxFit.contain,
|
|
|
|
|
alignment: Alignment.center,
|
|
|
|
|
child: SizedBox(
|
|
|
|
|
width: logicWidth,
|
|
|
|
|
height: logicHeight,
|
|
|
|
|
child: install(
|
|
|
|
|
getSelectedLocPack(),
|
|
|
|
|
getChosenLayout(),
|
|
|
|
|
getChosenVariant(),
|
|
|
|
@ -579,6 +663,9 @@ class _JadeguiState extends State<Jadegui> {
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
writeToLog,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|