chore: add always_put_control_body_on_new_line lint (#28352)

Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
shenlong
2026-05-12 00:47:24 +07:00
committed by GitHub
parent 7837d40f57
commit 12f7b2a005
122 changed files with 774 additions and 263 deletions
+21 -7
View File
@@ -32,10 +32,14 @@ Future<void> migrateDatabaseIfNeeded(Drift drift) async {
Future<void> _migrateTo25() async {
final accessToken = Store.tryGet(StoreKey.accessToken);
if (accessToken == null || accessToken.isEmpty) return;
if (accessToken == null || accessToken.isEmpty) {
return;
}
final serverUrls = ApiService.getServerUrls();
if (serverUrls.isEmpty) return;
if (serverUrls.isEmpty) {
return;
}
await NetworkRepository.setHeaders(ApiService.getRequestHeaders(), serverUrls, token: accessToken);
}
@@ -79,7 +83,9 @@ class _StoreMigrator {
Future<void> migrateEnumIndex<T extends Enum>(StoreKey<int> legacyKey, MetadataKey<T> newKey, List<T> values) async {
final index = await readLegacyStoreInt(legacyKey.id);
if (index == null) return;
if (index == null) {
return;
}
final enumValue = values.elementAtOrNull(index) ?? newKey.defaultValue;
_cache[newKey] = enumValue;
@@ -92,7 +98,9 @@ class _StoreMigrator {
List<T> values,
) async {
final name = await readLegacyStoreString(legacyKey.id);
if (name == null) return;
if (name == null) {
return;
}
final enumValue = values.firstWhere((e) => e.name == name, orElse: () => newKey.defaultValue);
_cache[newKey] = enumValue;
@@ -101,7 +109,9 @@ class _StoreMigrator {
Future<void> migrateBool(StoreKey<bool> legacyKey, MetadataKey<bool> newKey) async {
final intValue = await readLegacyStoreInt(legacyKey.id);
if (intValue == null) return;
if (intValue == null) {
return;
}
final boolValue = intValue != 0;
_cache[newKey] = boolValue;
@@ -110,7 +120,9 @@ class _StoreMigrator {
Future<void> migrateInt(StoreKey<int> legacyKey, MetadataKey<int> newKey) async {
final intValue = await readLegacyStoreInt(legacyKey.id);
if (intValue == null) return;
if (intValue == null) {
return;
}
_cache[newKey] = intValue;
_migratedStoreIds.add(legacyKey.id);
@@ -140,7 +152,9 @@ class _StoreMigrator {
}
Future<void> deleteLegacyStoreRows(List<int> ids) async {
if (ids.isEmpty) return;
if (ids.isEmpty) {
return;
}
await (_db.storeEntity.delete()..where((t) => t.id.isIn(ids))).go();
}
}