This commit is contained in:
Alessandro Autiero
2024-05-20 17:24:00 +02:00
parent 7c2caed16c
commit 9f5590d41c
562 changed files with 3303 additions and 156787 deletions

View File

@@ -1,6 +1,4 @@
import 'package:fluent_ui/fluent_ui.dart';
import 'package:reboot_launcher/src/dialog/abstract/info_bar.dart' as messenger;
import 'package:reboot_launcher/src/page/abstract/page_setting.dart';
import 'package:reboot_launcher/src/page/abstract/page_type.dart';
abstract class RebootPage extends StatefulWidget {
@@ -14,9 +12,7 @@ abstract class RebootPage extends StatefulWidget {
int get index => type.index;
List<PageSetting> get settings;
bool get hasButton;
bool hasButton(String? pageName);
@override
RebootPageState createState();
@@ -49,21 +45,9 @@ abstract class RebootPageState<T extends RebootPage> extends State<T> with Autom
);
}
OverlayEntry showInfoBar(dynamic text, {InfoBarSeverity severity = InfoBarSeverity.info, bool loading = false, Duration? duration = snackbarShortDuration, Widget? action}) => messenger.showInfoBar(
text,
pageType: widget.type,
severity: severity,
loading: loading,
duration: duration,
action: action
);
ListView get _listView => ListView.builder(
itemCount: settings.length * 2,
itemBuilder: (context, index) => index.isEven ? Align(
alignment: Alignment.center,
child: settings[index ~/ 2],
) : const SizedBox(height: 8.0),
itemCount: settings.length,
itemBuilder: (context, index) => settings[index],
);
@override

View File

@@ -1,26 +0,0 @@
class PageSetting {
final String name;
final String description;
final String? content;
final List<PageSetting>? children;
final int pageIndex;
PageSetting(
{required this.name,
required this.description,
this.content,
this.children,
this.pageIndex = -1});
PageSetting withPageIndex(int pageIndex) => this.pageIndex != -1
? this
: PageSetting(
name: name,
description: description,
content: content,
children: children,
pageIndex: pageIndex);
@override
String toString() => "$name: $description";
}

View File

@@ -0,0 +1,13 @@
class PageSuggestion {
final String name;
final String description;
final String? content;
final int pageIndex;
final String? routeName;
PageSuggestion({required this.name,
required this.description,
this.content,
required this.pageIndex,
this.routeName});
}