opt.: RNode

This commit is contained in:
lollipopkit
2024-06-08 15:35:19 +08:00
parent da48d1f66c
commit 8121eef839
8 changed files with 20 additions and 44 deletions

View File

@@ -170,7 +170,7 @@ class Backup {
}
Pros.reload();
RebuildNodes.app.rebuild();
RNodes.app.build();
_logger.info('Restore success');
}

View File

@@ -1,5 +0,0 @@
typedef GhId = String;
extension GhIdX on GhId {
String get url => 'https://github.com/$this';
}

View File

@@ -1,23 +0,0 @@
import 'package:flutter/foundation.dart';
class RebuildNode implements Listenable {
final List<VoidCallback> _listeners = [];
RebuildNode();
@override
void addListener(VoidCallback listener) {
_listeners.add(listener);
}
@override
void removeListener(VoidCallback listener) {
_listeners.remove(listener);
}
void rebuild() {
for (var listener in _listeners) {
listener();
}
}
}

View File

@@ -1,5 +1,3 @@
import 'package:toolbox/data/model/app/github_id.dart';
abstract final class GithubIds {
// Thanks
// If you want to change your Github ID, please open an issue.
@@ -75,3 +73,9 @@ abstract final class GithubIds {
'Jasonzhu1207',
};
}
typedef GhId = String;
extension GhIdX on GhId {
String get url => 'https://github.com/$this';
}

View File

@@ -1,5 +1,6 @@
import 'package:toolbox/data/model/app/rebuild.dart';
import 'package:fl_lib/fl_lib.dart';
abstract final class RebuildNodes {
static final app = RebuildNode();
}
abstract final class RNodes {
static final app = RNode();
static final dark = false.vn;
}