mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-20 11:08:03 +08:00
@@ -8,14 +8,14 @@ sealed class LoadingState<T> {
|
||||
bool get isSuccess => this is Success<T>;
|
||||
|
||||
T get data => switch (this) {
|
||||
Success(:var response) => response,
|
||||
_ => throw this,
|
||||
};
|
||||
Success(:var response) => response,
|
||||
_ => throw this,
|
||||
};
|
||||
|
||||
T? get dataOrNull => switch (this) {
|
||||
Success(:var response) => response,
|
||||
_ => null,
|
||||
};
|
||||
Success(:var response) => response,
|
||||
_ => null,
|
||||
};
|
||||
|
||||
void toast() => SmartDialog.showToast(toString());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user