mirror of
https://github.com/Auties00/Reboot-Launcher.git
synced 2026-01-13 19:22:22 +01:00
9.0.2
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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";
|
||||
}
|
||||
13
gui/lib/src/page/abstract/page_suggestion.dart
Normal file
13
gui/lib/src/page/abstract/page_suggestion.dart
Normal 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});
|
||||
}
|
||||
Reference in New Issue
Block a user