Getting ready for The Big Merge©®️™!
This commit is contained in:
parent
b537c74b21
commit
9ab0f54f14
|
|
@ -9,17 +9,6 @@ import 'package:quickgui/src/model/version.dart';
|
||||||
import 'package:tuple/tuple.dart';
|
import 'package:tuple/tuple.dart';
|
||||||
import 'package:window_size/window_size.dart';
|
import 'package:window_size/window_size.dart';
|
||||||
|
|
||||||
void main() async {
|
|
||||||
WidgetsFlutterBinding.ensureInitialized();
|
|
||||||
Directory.current = gCurrentDirectoy;
|
|
||||||
setWindowTitle('Quickgui : a flutter frontend for Quickget and Quickemu');
|
|
||||||
setWindowMinSize(const Size(692, 580));
|
|
||||||
setWindowMaxSize(const Size(692, 580));
|
|
||||||
gOperatingSystems = await loadOperatingSystems(false);
|
|
||||||
|
|
||||||
runApp(const App());
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<List<OperatingSystem>> loadOperatingSystems(bool showUbuntus) async {
|
Future<List<OperatingSystem>> loadOperatingSystems(bool showUbuntus) async {
|
||||||
var process = await Process.run('quickget', ['list_csv']);
|
var process = await Process.run('quickget', ['list_csv']);
|
||||||
var stdout = process.stdout as String;
|
var stdout = process.stdout as String;
|
||||||
|
|
@ -52,3 +41,14 @@ Future<List<OperatingSystem>> loadOperatingSystems(bool showUbuntus) async {
|
||||||
|
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void main() async {
|
||||||
|
WidgetsFlutterBinding.ensureInitialized();
|
||||||
|
Directory.current = gCurrentDirectoy;
|
||||||
|
setWindowTitle('Quickgui : a flutter frontend for Quickget and Quickemu');
|
||||||
|
setWindowMinSize(const Size(692, 580));
|
||||||
|
setWindowMaxSize(const Size(692, 580));
|
||||||
|
gOperatingSystems = await loadOperatingSystems(false);
|
||||||
|
|
||||||
|
runApp(const App());
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:quickgui/src/widgets/home_page/downloader_menu.dart';
|
||||||
|
import 'package:quickgui/src/widgets/home_page/logo.dart';
|
||||||
|
|
||||||
|
class DownloaderPage extends StatelessWidget {
|
||||||
|
const DownloaderPage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
title: const Text('Downloader'),
|
||||||
|
),
|
||||||
|
body: Column(
|
||||||
|
children: const [
|
||||||
|
Logo(),
|
||||||
|
DownloaderMenu(),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,9 +1,8 @@
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:file_picker/file_picker.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:quickgui/src/globals.dart';
|
import 'package:quickgui/src/widgets/home_page/logo.dart';
|
||||||
import 'package:quickgui/src/widgets/home_page/home_page_button_group.dart';
|
import 'package:quickgui/src/widgets/home_page/main_menu.dart';
|
||||||
|
|
||||||
class MainPage extends StatefulWidget {
|
class MainPage extends StatefulWidget {
|
||||||
const MainPage({Key? key, required this.title}) : super(key: key);
|
const MainPage({Key? key, required this.title}) : super(key: key);
|
||||||
|
|
@ -17,64 +16,20 @@ class MainPage extends StatefulWidget {
|
||||||
class _MainPageState extends State<MainPage> {
|
class _MainPageState extends State<MainPage> {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
//Directory.current = '/home/yannick';
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
title: const Text('Main menu'),
|
||||||
|
leading: IconButton(
|
||||||
|
onPressed: () {
|
||||||
|
exit(0);
|
||||||
|
},
|
||||||
|
icon: const Icon(Icons.exit_to_app),
|
||||||
|
),
|
||||||
|
),
|
||||||
body: Column(
|
body: Column(
|
||||||
children: [
|
children: const [
|
||||||
SizedBox(
|
Logo(),
|
||||||
height: 250,
|
MainMenu(),
|
||||||
child: Flex(
|
|
||||||
direction: Axis.vertical,
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
child: Center(
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.all(8.0),
|
|
||||||
child: Image.asset('assets/images/logo.png'),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
child: Container(
|
|
||||||
color: Colors.pink,
|
|
||||||
child: Column(
|
|
||||||
children: [
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
child: Column(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
|
||||||
children: const [
|
|
||||||
Padding(
|
|
||||||
padding: EdgeInsets.symmetric(horizontal: 12),
|
|
||||||
child: HomePageButtonGroup(),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
InkWell(
|
|
||||||
onTap: () async {
|
|
||||||
var folder = await FilePicker.platform.getDirectoryPath(dialogTitle: "Pick a folder");
|
|
||||||
if (folder != null) {
|
|
||||||
setState(() {
|
|
||||||
gCurrentDirectoy = Directory(folder);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
child: Text(
|
|
||||||
"Working directory : ${gCurrentDirectoy.path}",
|
|
||||||
style: Theme.of(context).textTheme.subtitle1!.copyWith(color: Colors.white),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,57 @@
|
||||||
|
import 'dart:io';
|
||||||
|
|
||||||
|
import 'package:file_picker/file_picker.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:quickgui/src/globals.dart';
|
||||||
|
import 'package:quickgui/src/widgets/home_page/home_page_button_group.dart';
|
||||||
|
|
||||||
|
class DownloaderMenu extends StatefulWidget {
|
||||||
|
const DownloaderMenu({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<DownloaderMenu> createState() => _DownloaderMenuState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _DownloaderMenuState extends State<DownloaderMenu> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Expanded(
|
||||||
|
child: Container(
|
||||||
|
color: Colors.pink,
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
children: const [
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 12),
|
||||||
|
child: HomePageButtonGroup(),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
InkWell(
|
||||||
|
onTap: () async {
|
||||||
|
var folder = await FilePicker.platform.getDirectoryPath(dialogTitle: "Pick a folder");
|
||||||
|
if (folder != null) {
|
||||||
|
setState(() {
|
||||||
|
gCurrentDirectoy = Directory(folder);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
child: Text(
|
||||||
|
"Working directory : ${gCurrentDirectoy.path}",
|
||||||
|
style: Theme.of(context).textTheme.subtitle1!.copyWith(color: Colors.white),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,27 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class Logo extends StatelessWidget {
|
||||||
|
const Logo({
|
||||||
|
Key? key,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return SizedBox(
|
||||||
|
height: 250,
|
||||||
|
child: Flex(
|
||||||
|
direction: Axis.vertical,
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Center(
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Image.asset('assets/images/logo.png'),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,41 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:quickgui/src/pages/downloader_page.dart';
|
||||||
|
import 'package:quickgui/src/widgets/home_page/home_page_button.dart';
|
||||||
|
|
||||||
|
class MainMenu extends StatelessWidget {
|
||||||
|
const MainMenu({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Expanded(
|
||||||
|
child: Container(
|
||||||
|
color: Colors.pink,
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
HomePageButton(
|
||||||
|
onPressed: () {},
|
||||||
|
text: 'Manage existing machines',
|
||||||
|
),
|
||||||
|
HomePageButton(
|
||||||
|
onPressed: () {
|
||||||
|
//Navigator.of(context).push(MaterialPageRoute(builder: (context) => const DownloaderPage()));
|
||||||
|
Navigator.of(context).push(
|
||||||
|
PageRouteBuilder(
|
||||||
|
fullscreenDialog: true,
|
||||||
|
pageBuilder: (context, animation1, animation2) => const DownloaderPage(),
|
||||||
|
transitionDuration: Duration.zero,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
text: 'Create new machines',
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue