Files
MWClash/lib/common/mixin.dart
chen08209 7635a4e086 Add android separates the core process
Support core status check and force restart

Update flutter and pub dependencies
2025-08-25 15:15:59 +08:00

21 lines
385 B
Dart

import 'package:riverpod/riverpod.dart';
mixin AutoDisposeNotifierMixin<T> on AnyNotifier<T, T> {
set value(T value) {
if (ref.mounted) {
state = value;
}
}
@override
bool updateShouldNotify(previous, next) {
final res = super.updateShouldNotify(previous, next);
if (res) {
onUpdate(next);
}
return res;
}
void onUpdate(T value) {}
}