fix: save route's

This commit is contained in:
2025-09-06 21:18:18 +03:30
parent d2e74e6627
commit 1bc449c9be
3 changed files with 23 additions and 30 deletions

View File

@@ -16,21 +16,12 @@ class AppModel extends HiveObject {
@HiveField(3)
List<TargetPage>? targetPages;
AppModel({this.isFirstRun, this.isDarkMode, this.selectedModule, this.targetPages});
AppModel copyWith({
bool? isFirstRun,
bool? isDarkMode,
Module? selectedModule,
List<TargetPage>? targetPages,
}) {
return AppModel(
isFirstRun: isFirstRun ?? this.isFirstRun,
isDarkMode: isDarkMode ?? this.isDarkMode,
selectedModule: selectedModule ?? this.selectedModule,
targetPages: targetPages ?? this.targetPages,
);
}
AppModel({
this.isFirstRun,
this.isDarkMode,
this.selectedModule,
this.targetPages,
});
@override
String toString() {
@@ -51,11 +42,8 @@ class TargetPage extends HiveObject {
TargetPage({required this.route, this.functions, this.module});
TargetPage copyWith({String? route, List<String>? functions, Module? module}) {
return TargetPage(
route: route ?? this.route,
functions: functions ?? this.functions,
module: module ?? this.module,
);
@override
String toString() {
return 'TargetPage{route: $route, functions: $functions, module: $module}';
}
}