diff --git a/lib/classes/install_prefs.dart b/lib/classes/install_prefs.dart index 3c75ff8..f89ba8e 100644 --- a/lib/classes/install_prefs.dart +++ b/lib/classes/install_prefs.dart @@ -17,6 +17,7 @@ class InstallPrefs { final String hostname; final bool ipv6; final bool enableTimeshift; + final bool enableFlatpak; final bool manualPartitioning; final List partitions; @@ -36,6 +37,7 @@ class InstallPrefs { this.hostname = "", this.ipv6 = false, this.enableTimeshift = false, + this.enableFlatpak = false, this.manualPartitioning = false, this.partitions = const [], }); @@ -72,6 +74,7 @@ class InstallPrefs { "rootpass": rootPass, "desktop": desktop.name, "timeshift": enableTimeshift, + "flatpak": enableFlatpak, "extra_packages": [ "firefox", ] diff --git a/lib/functions/install.dart b/lib/functions/install.dart index 8fbe8b3..9127c96 100644 --- a/lib/functions/install.dart +++ b/lib/functions/install.dart @@ -33,6 +33,7 @@ Widget install( String hostname, bool ipv6, bool enableTimeshift, + bool enableFlatpak, setOutput, output, running, @@ -67,6 +68,7 @@ Widget install( hostname: hostname, ipv6: ipv6, enableTimeshift: enableTimeshift, + enableFlatpak: enableFlatpak, ); String jsonPrefs = jsonEncode(prefs.toJson()); //writeConfig(jsonPrefs); @@ -94,14 +96,6 @@ Widget install( borderRadius: BorderRadius.circular(10), border: Border.all(color: Colors.black), color: const Color.fromARGB(255, 15, 15, 15), - //color: Colors.black, - /*boxShadow: const [ - BoxShadow( - color: Colors.black, - blurRadius: 2, - offset: Offset(-2, 3), - ), - ]*/ ), child: SingleChildScrollView( reverse: true, diff --git a/lib/functions/misc.dart b/lib/functions/misc.dart index 05ca4d5..f33e2a3 100644 --- a/lib/functions/misc.dart +++ b/lib/functions/misc.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:adwaita_icons/adwaita_icons.dart'; final _formKey = GlobalKey(); RegExp hostnameRegex = RegExp( @@ -16,7 +17,10 @@ Widget misc( setConfirmRootPass, rootPass, confirmRootPass, + enableFlatpak, + setFlatpak, next) { + bool flatpak = true; return Column( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -258,16 +262,21 @@ Widget misc( message: "Installs flatpak and enables flathub", child: CheckboxListTile( title: const Text('Enable flatpak', - style: TextStyle(color: Colors.white)), - value: flatpak, - onChanged: () {}, + style: TextStyle(color: Colors.white)), + value: enableFlatpak, + onChanged: (bool? value) { + setFlatpak(value!); + }, secondary: Container( - decoration: const BlxDecoration( + decoration: const BoxDecoration( shape: BoxShape.circle, color: Colors.white, ), padding: const EdgeInsets.fromLTRB(10, 10, 10, 13), - child: const Icon(Icons.box, color: Colors.black), + child: const AdwaitaIcon( + AdwaitaIcons.package_x_generic, + color: Colors.black, + ), ), ), ), diff --git a/lib/functions/summary.dart b/lib/functions/summary.dart index 6bcd01a..3586c5e 100644 --- a/lib/functions/summary.dart +++ b/lib/functions/summary.dart @@ -56,6 +56,7 @@ Widget summary( String hostname, bool ipv6, bool enableTimeshift, + bool enableFlatpak, String rotational, String diskSize, setDiskType, @@ -293,6 +294,9 @@ Widget summary( const SizedBox(height: 10), infoTextTemplate( "Enable timeshift", enableTimeshift.toString()), + const SizedBox(height: 10), + infoTextTemplate( + "Install flatpak,", enableFlatpak.toString()), ], ), ), diff --git a/lib/locales/locales.dart b/lib/locales/locales.dart index fc5115b..9c82ded 100644 --- a/lib/locales/locales.dart +++ b/lib/locales/locales.dart @@ -12,7 +12,6 @@ import 'package:jade_gui/locales/europe.dart'; import 'package:jade_gui/locales/indian.dart'; import 'package:jade_gui/locales/mexico.dart'; import 'package:jade_gui/locales/pacific.dart'; -import 'package:jade_gui/locales/us.dart'; import 'package:jade_gui/classes/location.dart'; class Local { @@ -37,5 +36,4 @@ List locations = [ Local(indian, "Indian"), Local(mexico, "Mexico"), Local(pacific, "Pacific"), - Local(us, "US"), ]; diff --git a/lib/main.dart b/lib/main.dart index bf4e2c9..91911ed 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -120,6 +120,7 @@ class _JadeguiState extends State { bool isEfi = false; bool ipv6 = false; bool enableTimeshift = true; + bool enableFlatpak = true; bool connected = false; bool manualPartitioning = false; bool running = false; @@ -571,6 +572,13 @@ class _JadeguiState extends State { _selectedIndex = _selectedIndex + 1; }); }, + enableFlatpak, + (value) { + setState(() { + enableFlatpak = value; + writeToLog("Enable flatpak: $enableFlatpak"); + }); + }, ), ), ), @@ -700,6 +708,7 @@ class _JadeguiState extends State { hostname, ipv6, enableTimeshift, + enableFlatpak, _diskType, diskInfo, (value) { @@ -747,6 +756,7 @@ class _JadeguiState extends State { hostname, ipv6, enableTimeshift, + enableFlatpak, (value) { setState(() { if (value.compareTo(output) == 1) { diff --git a/pubspec.lock b/pubspec.lock index d070d2f..200ebb3 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1,6 +1,13 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: + adwaita_icons: + dependency: "direct main" + description: + name: adwaita_icons + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.1" args: dependency: transitive description: @@ -90,6 +97,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.0.4" + flutter_svg: + dependency: transitive + description: + name: flutter_svg + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.3" flutter_test: dependency: "direct dev" description: flutter @@ -130,6 +144,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.8.0" + path_drawing: + dependency: transitive + description: + name: path_drawing + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" + path_parsing: + dependency: transitive + description: + name: path_parsing + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" path_provider: dependency: "direct main" description: @@ -179,6 +207,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.0.5" + petitparser: + dependency: transitive + description: + name: petitparser + url: "https://pub.dartlang.org" + source: hosted + version: "4.4.0" platform: dependency: transitive description: @@ -305,6 +340,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.2.0+1" + xml: + dependency: transitive + description: + name: xml + url: "https://pub.dartlang.org" + source: hosted + version: "5.3.1" yaml: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 16ac999..49a706b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -41,6 +41,7 @@ dependencies: url: https://github.com/google/flutter-desktop-embedding.git path: plugins/window_size ref: a738913c8ce2c9f47515382d40827e794a334274 + adwaita_icons: ^0.2.1 dev_dependencies: