refactor: Added and applied require_trailing_commas linter rule
This commit is contained in:
parent
adb3f766e5
commit
ec7acc5385
112 changed files with 3466 additions and 2855 deletions
|
|
@ -15,8 +15,10 @@ extension ClientStoriesExtension on Client {
|
|||
|
||||
List<User> get contacts => rooms
|
||||
.where((room) => room.isDirectChat)
|
||||
.map((room) =>
|
||||
room.unsafeGetUserFromMemoryOrFallback(room.directChatMatrixID!))
|
||||
.map(
|
||||
(room) =>
|
||||
room.unsafeGetUserFromMemoryOrFallback(room.directChatMatrixID!),
|
||||
)
|
||||
.toList();
|
||||
|
||||
List<Room> get storiesRooms =>
|
||||
|
|
@ -78,23 +80,30 @@ extension ClientStoriesExtension on Client {
|
|||
}
|
||||
|
||||
Future<Room?> getStoriesRoom(BuildContext context) async {
|
||||
final candidates = rooms.where((room) =>
|
||||
room.getState(EventTypes.RoomCreate)?.content.tryGet<String>('type') ==
|
||||
storiesRoomType &&
|
||||
room.ownPowerLevel >= 100);
|
||||
final candidates = rooms.where(
|
||||
(room) =>
|
||||
room
|
||||
.getState(EventTypes.RoomCreate)
|
||||
?.content
|
||||
.tryGet<String>('type') ==
|
||||
storiesRoomType &&
|
||||
room.ownPowerLevel >= 100,
|
||||
);
|
||||
if (candidates.isEmpty) return null;
|
||||
if (candidates.length == 1) return candidates.single;
|
||||
return await showModalActionSheet<Room>(
|
||||
context: context,
|
||||
actions: candidates
|
||||
.map(
|
||||
(room) => SheetAction(
|
||||
label: room.getLocalizedDisplayname(
|
||||
MatrixLocals(L10n.of(context)!),
|
||||
),
|
||||
key: room),
|
||||
)
|
||||
.toList());
|
||||
context: context,
|
||||
actions: candidates
|
||||
.map(
|
||||
(room) => SheetAction(
|
||||
label: room.getLocalizedDisplayname(
|
||||
MatrixLocals(L10n.of(context)!),
|
||||
),
|
||||
key: room,
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,8 @@ class FlutterHiveCollectionsDatabase extends HiveCollectionsDatabase {
|
|||
static const String _cipherStorageKey = 'hive_encryption_key';
|
||||
|
||||
static Future<FlutterHiveCollectionsDatabase> databaseBuilder(
|
||||
Client client) async {
|
||||
Client client,
|
||||
) async {
|
||||
Logs().d('Open Hive...');
|
||||
HiveAesCipher? hiverCipher;
|
||||
try {
|
||||
|
|
@ -96,9 +97,9 @@ class FlutterHiveCollectionsDatabase extends HiveCollectionsDatabase {
|
|||
}
|
||||
}
|
||||
// do not destroy your stable FluffyChat in debug mode
|
||||
directory = Directory(directory.uri
|
||||
.resolve(kDebugMode ? 'hive_debug' : 'hive')
|
||||
.toFilePath());
|
||||
directory = Directory(
|
||||
directory.uri.resolve(kDebugMode ? 'hive_debug' : 'hive').toFilePath(),
|
||||
);
|
||||
directory.create(recursive: true);
|
||||
path = directory.path;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,8 +8,9 @@ extension IosBadgeClientExtension on Client {
|
|||
void updateIosBadge() {
|
||||
if (PlatformInfos.isIOS) {
|
||||
// Workaround for iOS not clearing notifications with fcm_shared_isolate
|
||||
if (!rooms.any((r) =>
|
||||
r.membership == Membership.invite || (r.notificationCount > 0))) {
|
||||
if (!rooms.any(
|
||||
(r) => r.membership == Membership.invite || (r.notificationCount > 0),
|
||||
)) {
|
||||
// ignore: unawaited_futures
|
||||
FlutterLocalNotificationsPlugin().cancelAll();
|
||||
FlutterAppBadger.removeBadge();
|
||||
|
|
|
|||
|
|
@ -62,7 +62,9 @@ class MatrixLocals extends MatrixLocalizations {
|
|||
|
||||
@override
|
||||
String changedTheGuestAccessRulesTo(
|
||||
String senderName, String localizedString) {
|
||||
String senderName,
|
||||
String localizedString,
|
||||
) {
|
||||
return l10n.changedTheGuestAccessRulesTo(senderName, localizedString);
|
||||
}
|
||||
|
||||
|
|
@ -73,7 +75,9 @@ class MatrixLocals extends MatrixLocalizations {
|
|||
|
||||
@override
|
||||
String changedTheHistoryVisibilityTo(
|
||||
String senderName, String localizedString) {
|
||||
String senderName,
|
||||
String localizedString,
|
||||
) {
|
||||
return l10n.changedTheHistoryVisibilityTo(senderName, localizedString);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue