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
@@ -5,7 +5,9 @@ class ApiRepository {
Future<T> checkNull<T>(Future<T?> future) async {
final response = await future;
if (response == null) throw const NoResponseDtoError();
if (response == null) {
throw const NoResponseDtoError();
}
return response;
}
}
@@ -48,7 +48,9 @@ class MetadataRepository extends DriftDatabaseRepository {
T _read<T extends Object>(MetadataKey<T> key) => (_cache[key] as T?) ?? key.defaultValue;
Future<void> write<T extends Object, U extends T>(MetadataKey<T> key, U value) async {
if (_read(key) == value) return;
if (_read(key) == value) {
return;
}
await _db
.into(_db.metadataEntity)
@@ -79,13 +81,17 @@ class MetadataRepository extends DriftDatabaseRepository {
final keyMap = MetadataKey.asKeyMap();
for (final row in rows) {
final key = keyMap[row.key];
if (key == null) continue;
if (key == null) {
continue;
}
_updateCache(key, key.decode(row.value));
}
}
void _updateCache<T extends Object>(MetadataKey<T> key, T value) {
if (_cache[key] == value) return;
if (_cache[key] == value) {
return;
}
_cache[key] = value;
key.domain.rebuild(this);
}
@@ -360,7 +360,9 @@ class DriftRemoteAlbumRepository extends DriftDatabaseRepository {
}
Future<List<String>> getSortedAlbumIds(List<String> albumIds, {required AssetDateAggregation aggregation}) async {
if (albumIds.isEmpty) return [];
if (albumIds.isEmpty) {
return [];
}
final jsonIds = jsonEncode(albumIds);
final sqlAgg = aggregation == AssetDateAggregation.start ? 'MIN' : 'MAX';
@@ -12,7 +12,9 @@ class DriftAuthUserRepository extends DriftDatabaseRepository {
Future<UserDto?> get(String id) async {
final user = await _db.managers.authUserEntity.filter((user) => user.id.equals(id)).getSingleOrNull();
if (user == null) return null;
if (user == null) {
return null;
}
final query = _db.userMetadataEntity.select()..where((e) => e.userId.equals(id));
final metadata = await query.map((row) => row.toDto()).get();
@@ -12,7 +12,9 @@ class UserApiRepository extends ApiRepository {
Future<UserDto?> getMyUser() async {
final (adminDto, preferenceDto) = await (_api.getMyUser(), _api.getMyPreferences()).wait;
if (adminDto == null) return null;
if (adminDto == null) {
return null;
}
return UserConverter.fromAdminDto(adminDto, preferenceDto);
}