* opt: _onTapUp

* opt: set contains

* opt: elementAtOrNull
This commit is contained in:
My-Responsitories
2026-02-02 20:12:12 +08:00
committed by GitHub
parent 37fa165f59
commit 7260a387f9
12 changed files with 46 additions and 36 deletions

View File

@@ -1,5 +1,4 @@
import 'package:PiliPlus/models/common/account_type.dart';
import 'package:PiliPlus/utils/extension/iterable_ext.dart';
import 'package:hive/hive.dart';
class AccountTypeAdapter extends TypeAdapter<AccountType> {
@@ -8,7 +7,7 @@ class AccountTypeAdapter extends TypeAdapter<AccountType> {
@override
AccountType read(BinaryReader reader) =>
AccountType.values.getOrNull(reader.readByte()) ?? AccountType.main;
AccountType.values.elementAtOrNull(reader.readByte()) ?? AccountType.main;
@override
void write(BinaryWriter writer, AccountType obj) {