add desktop screen

pull/2/head
axtloss 3 years ago
parent ae05fc1bc8
commit 7002f3efa8
No known key found for this signature in database
GPG Key ID: 6672E6DD65BEA50B

@ -0,0 +1,13 @@
class Desktop {
String name = "";
String displayManager = "";
List<String> packages = [];
String imageurl = "";
Desktop({
this.name = "",
this.displayManager = "",
this.packages = const [""],
this.imageurl = 'assets/jade_logo.png',
});
}

@ -0,0 +1,84 @@
import 'package:jade_gui/classes/desktop.dart';
List<Desktop> desktops = [
Desktop(
name: "onyx",
displayManager: "lightdm",
packages: [
"onyx",
"xorg-server",
"budgie-desktop",
"gnome",
],
imageurl: 'assets/jade_logo.png',
),
Desktop(
name: "Gnome",
displayManager: "gdm",
packages: [
"gnome",
"xorg",
"gnome-extra",
"chrome-gnome-shell",
],
//imageurl: '',
),
Desktop(
name: "KDE plasma",
displayManager: "sddm",
packages: [
"plasma",
"xorg",
"kde-applications",
"sddm",
],
),
Desktop(
name: "Budgie",
displayManager: "lightdm",
packages: [
"budgie-desktop",
"xorg",
"gnome",
],
//imageurl: "",
),
Desktop(
name: "Mate",
displayManager: "lightdm",
packages: [
"mate",
"mate-extra",
"mate-applet-dock",
"mate-applet-streamer",
"xorg",
"mate-extra",
"mate-desktop",
],
//imageurl: "",
),
Desktop(
name: "Enlightenment",
displayManager: "",
packages: [
"enlightenment",
"terminology",
],
//imageurl: "",
),
Desktop(
name: "XFCE",
displayManager: "lightdm",
packages: [
"xfce4",
"xfce4-goodies",
],
//imageurl: "",
),
Desktop(
name: "None/DIY",
displayManager: "",
packages: [],
//imageurl: "",
),
];

@ -0,0 +1,153 @@
import 'package:flutter/material.dart';
import 'package:jade_gui/desktops/desktops.dart';
Widget desktopTemplate(desktop, setDesktop) {
return Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Container(
padding: const EdgeInsets.all(2),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(5),
border: Border.all(color: Colors.black45),
color: const Color.fromARGB(255, 30, 30, 30),
),
child: ElevatedButton(
onPressed: () {
setDesktop(desktop);
},
style: TextButton.styleFrom(
primary: Colors.white,
backgroundColor: const Color.fromARGB(0, 169, 0, 255),
shadowColor: const Color.fromARGB(0, 169, 0, 255),
padding: const EdgeInsets.all(10),
),
child: Text(
desktop.name,
style: const TextStyle(
fontWeight: FontWeight.bold,
),
),
),
),
const SizedBox(height: 10),
],
);
}
Widget desktopView(currDesktop, setDesktop, next) {
return Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
const Text(
'Please select a Desktop',
style: TextStyle(
fontSize: 50,
fontWeight: FontWeight.bold,
color: Color.fromARGB(255, 169, 0, 255)),
),
const SizedBox(height: 20),
Expanded(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
const SizedBox(width: 40),
Expanded(
child: Container(
padding: const EdgeInsets.all(10),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
border: Border.all(color: Colors.black),
color: const Color.fromARGB(255, 30, 30, 30),
boxShadow: const [
BoxShadow(
color: Colors.black,
blurRadius: 2,
offset: Offset(-2, 3),
),
],
),
child: Expanded(
child: SingleChildScrollView(
primary: false,
child: Column(
//mainAxisAlignment: MainAxisAlignment.spaceEvenly,
//crossAxisAlignment: CrossAxisAlignment.stretch,
children: desktops
.map<Widget>(
(desktop) => desktopTemplate(desktop, setDesktop))
.toList(),
),
),
),
),
),
const SizedBox(width: 100),
Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Column(
children: [
const Text(
'Currently chosen Desktop: ',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
color: Color.fromARGB(255, 169, 0, 255),
),
),
Text(
currDesktop.name,
style: const TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
color: Color.fromARGB(255, 169, 0, 255),
),
),
const SizedBox(height: 20),
Image(image: AssetImage(currDesktop.imageurl)),
],
),
],
),
const SizedBox(width: 40),
],
),
),
const SizedBox(height: 20),
const SizedBox(width: 60),
Column(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Column(
children: [
TextButton(
onPressed: () {
next();
},
child: const Text(
'Next',
),
style: TextButton.styleFrom(
primary: Colors.white,
backgroundColor: const Color.fromARGB(255, 169, 0, 255),
minimumSize: const Size(100, 50),
padding: const EdgeInsets.all(10),
),
),
const SizedBox(height: 10),
],
),
const SizedBox(width: 30),
],
),
const SizedBox(height: 7)
],
),
],
);
}

@ -4,7 +4,10 @@ import 'package:jade_gui/functions/welcome.dart';
import 'package:jade_gui/functions/locale.dart';
import 'package:jade_gui/functions/keyboard.dart';
import 'package:jade_gui/functions/users.dart';
import 'package:jade_gui/functions/desktop.dart';
import 'package:jade_gui/classes/keymap.dart';
import 'package:jade_gui/classes/desktop.dart';
import 'package:jade_gui/desktops/desktops.dart';
void main() => runApp(
const MaterialApp(
@ -32,6 +35,7 @@ class _JadeguiState extends State<Jadegui> {
String username = "";
String rootPass = "";
String confirmRootPass = "";
Desktop currDesktop = desktops[0];
void nextslide() {
setState(() {
_selectedIndex = _selectedIndex + 1;
@ -352,16 +356,22 @@ class _JadeguiState extends State<Jadegui> {
print("Password: $password");
print("Confirm Password: $confirmPassword");
print("Enable Root: $enableSudo");
widget = const Text(
'Showing Users screen',
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
color: Color.fromARGB(255, 169, 0, 255),
),
widget = desktopView(
currDesktop,
(selectedDesktop) {
setState(() {
currDesktop = selectedDesktop;
});
},
() {
setState(() {
_selectedIndex = _selectedIndex + 1;
});
},
);
break;
case 5:
print("Desktop: ${currDesktop.name}");
widget = const Text(
'Showing Desktop screen',
style: TextStyle(

Loading…
Cancel
Save