(maybe) fix password issue

pull/2/head
axtlos 3 years ago
parent 5a4994ae01
commit f8514daf7a
No known key found for this signature in database
GPG Key ID: A468AFD71DD51D4A

@ -1,3 +1,9 @@
Chosen location: Africa
Chosen Region: Johannesburg
Chosen location: Asia
Chosen Region: Aqtau
Chosen layout: at
Chosen variant: normal
Username: e
Username:
Username: u
Enable sudo: true

@ -12,7 +12,7 @@ test(setOutput, running, setRunning, config, writeToLog) async {
writeToLog("Json config: $config");
var process =
await Process.start('pkexec', ['jade', 'config', '/tmp/jade.json']);
//await Process.start('/opt/jade_gui/scripts/jadeemu.sh', []);
//await Process.start('/opt/jade_gui/scripts/jadeemu.sh', []);
process.stdout.transform(utf8.decoder).forEach(setOutput);
setRunning(true);
}

@ -5,6 +5,14 @@ import 'package:jade_gui/classes/location.dart';
Local chosenLocation = locations[0];
Location chosenRegion = locations[0].location[0];
String getChosenLocation() {
return chosenLocation.name;
}
Location getSelectedLocPack() {
return chosenRegion;
}
Widget regionTemplate(variant, chosenLayout, nextPage, writeToLog) {
return Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,

@ -1,223 +0,0 @@
import 'package:flutter/material.dart';
import 'package:jade_gui/locales/locales.dart';
import 'package:jade_gui/classes/location.dart';
Location choosenLocPack = const Location();
Widget locationTemplate(location, nextSlide) {
return Container(
padding: const EdgeInsets.all(8),
color: const Color.fromARGB(100, 169, 0, 255),
child: Container(
padding: const EdgeInsets.all(8),
color: const Color.fromARGB(100, 169, 0, 255),
child: ElevatedButton(
onPressed: () {
nextSlide();
choosenLocPack = location;
},
style: TextButton.styleFrom(
primary: Colors.white,
backgroundColor: const Color.fromARGB(100, 169, 0, 255),
padding: const EdgeInsets.all(10),
),
child: Column(
children: [
Image(
image: AssetImage(
'${location.image}',
),
height: 300,
width: 300,
),
Text(location.location,
style: const TextStyle(
fontWeight: FontWeight.bold,
)),
],
),
),
),
);
}
Widget location(region, nextSlide) {
return SingleChildScrollView(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
const SizedBox(height: 20),
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Text(
'Please choose your Locale',
style: TextStyle(
fontSize: 50,
fontWeight: FontWeight.bold,
color: Color.fromARGB(255, 169, 0, 255)),
),
Text(
'$region/',
style: const TextStyle(
fontSize: 30, color: Color.fromARGB(255, 169, 0, 255)),
)
],
),
const SizedBox(height: 10),
GridView.count(
primary: false,
padding: const EdgeInsets.all(20),
shrinkWrap: true,
crossAxisSpacing: 10,
mainAxisSpacing: 10,
crossAxisCount: 3,
children: options(region, locations, nextSlide),
),
],
),
);
}
List<Widget> options(region, locations, nextSlide) {
List<Widget> widget;
switch (region) {
case "Africa":
{
widget = locations[0]
.location
.map<Widget>((location) => locationTemplate(location, nextSlide))
.toList();
break;
}
case "America":
{
widget = locations[1]
.location
.map<Widget>((location) => locationTemplate(location, nextSlide))
.toList();
break;
}
case "Antarctica":
{
widget = locations[2]
.location
.map<Widget>((location) => locationTemplate(location, nextSlide))
.toList();
break;
}
case "Arctic":
{
widget = locations[3]
.location
.map<Widget>((location) => locationTemplate(location, nextSlide))
.toList();
break;
}
case "Asia":
{
widget = locations[4]
.location
.map<Widget>((location) => locationTemplate(location, nextSlide))
.toList();
break;
}
case "Atlantic":
{
widget = locations[5]
.location
.map<Widget>((location) => locationTemplate(location, nextSlide))
.toList();
break;
}
case "Australia":
{
widget = locations[6]
.location
.map<Widget>((location) => locationTemplate(location, nextSlide))
.toList();
break;
}
case "Brazil":
{
widget = locations[7]
.location
.map<Widget>((location) => locationTemplate(location, nextSlide))
.toList();
break;
}
case "Canada":
{
widget = locations[8]
.location
.map<Widget>((location) => locationTemplate(location, nextSlide))
.toList();
break;
}
case "Chile":
{
widget = locations[9]
.location
.map<Widget>((location) => locationTemplate(location, nextSlide))
.toList();
break;
}
case "Europe":
{
widget = locations[10]
.location
.map<Widget>((location) => locationTemplate(location, nextSlide))
.toList();
break;
}
case "Indian":
{
widget = locations[11]
.location
.map<Widget>((location) => locationTemplate(location, nextSlide))
.toList();
break;
}
case "Mexico":
{
widget = locations[12]
.location
.map<Widget>((location) => locationTemplate(location, nextSlide))
.toList();
break;
}
case "Pacific":
{
widget = locations[13]
.location
.map<Widget>((location) => locationTemplate(location, nextSlide))
.toList();
break;
}
case "US":
{
widget = locations[14]
.location
.map<Widget>((location) => locationTemplate(location, nextSlide))
.toList();
break;
}
default:
widget = const [
Text(
'You should not see this, report this at git.tar.black/crystal/jade_gui',
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
color: Colors.red,
),
),
];
}
// Finally returning a Widget
return widget;
}
Location getSelectedLocPack() {
return choosenLocPack;
}

@ -1,70 +0,0 @@
import 'package:flutter/material.dart';
String selectedRegion = "";
Widget locationTemplate(next, location) {
return Container(
padding: const EdgeInsets.all(8),
color: const Color.fromARGB(100, 169, 0, 255),
child: Container(
padding: const EdgeInsets.all(8),
color: const Color.fromARGB(100, 169, 0, 255),
child: ElevatedButton(
onPressed: () {
next();
selectedRegion = location.name;
},
style: TextButton.styleFrom(
primary: Colors.white,
backgroundColor: const Color.fromARGB(100, 169, 0, 255),
padding: const EdgeInsets.all(10),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(location.name),
],
),
),
),
);
}
Widget region(next, locations) {
return SingleChildScrollView(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
const SizedBox(height: 20),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: const [
Text(
'Please choose your Locale',
style: TextStyle(
fontSize: 50,
fontWeight: FontWeight.bold,
color: Color.fromARGB(255, 169, 0, 255)),
),
],
),
const SizedBox(height: 10),
GridView.count(
primary: false,
padding: const EdgeInsets.all(20),
shrinkWrap: true,
crossAxisSpacing: 10,
mainAxisSpacing: 10,
crossAxisCount: 3,
children: locations
.map<Widget>((location) => locationTemplate(next, location))
.toList(),
),
],
),
);
}
String getSelectedRegion() {
return selectedRegion;
}

@ -1,5 +1,4 @@
import 'package:flutter/material.dart';
import 'package:jade_gui/functions/location/location.dart';
import 'package:jade_gui/functions/welcome.dart';
import 'package:jade_gui/functions/locale.dart';
import 'package:jade_gui/functions/keyboard.dart';
@ -15,6 +14,8 @@ import 'package:jade_gui/desktops/desktops.dart';
import 'dart:io';
Map env = Platform.environment;
Future<void> checkIsEfi(
setState,
runningEfi,
@ -36,7 +37,9 @@ Future<void> checkIsEfi(
}
Future<void> writeToLog(String message) async {
await File('jade_log.txt').readAsString().then((String contents) {
await File('${env["HOME"]}/jade_log.txt')
.readAsString()
.then((String contents) {
File("jade_log.txt").writeAsString(contents + "\n" + message);
});
}
@ -55,7 +58,7 @@ Future<void> setPassword(clearPass, setState) async {
return result.stdout;
});
debugPrint(password);
setState(password);
setState(password.replaceAll("\n", ""));
}
class Jadegui extends StatefulWidget {
@ -405,7 +408,6 @@ class _JadeguiState extends State<Jadegui> {
});
},
);
break;
case 4:
debugPrint(password);

Loading…
Cancel
Save