refactor: Added and applied require_trailing_commas linter rule

This commit is contained in:
Malin Errenst 2023-03-02 10:57:52 +01:00
commit ec7acc5385
112 changed files with 3466 additions and 2855 deletions

View file

@ -26,37 +26,45 @@ class ReactionsPicker extends StatelessWidget {
height: (display) ? 56 : 0,
child: Material(
color: Colors.transparent,
child: Builder(builder: (context) {
if (!display) {
return Container();
}
final proposals = proposeEmojis(
child: Builder(
builder: (context) {
if (!display) {
return Container();
}
final proposals = proposeEmojis(
controller.selectedEvents.first.plaintextBody,
number: 25,
languageCodes: EmojiProposalLanguageCodes.values.toSet());
final emojis = proposals.isNotEmpty
? proposals.map((e) => e.char).toList()
: List<String>.from(AppEmojis.emojis);
final allReactionEvents = controller.selectedEvents.first
.aggregatedEvents(
controller.timeline!, RelationshipTypes.reaction)
.where((event) =>
event.senderId == event.room.client.userID &&
event.type == 'm.reaction');
languageCodes: EmojiProposalLanguageCodes.values.toSet(),
);
final emojis = proposals.isNotEmpty
? proposals.map((e) => e.char).toList()
: List<String>.from(AppEmojis.emojis);
final allReactionEvents = controller.selectedEvents.first
.aggregatedEvents(
controller.timeline!,
RelationshipTypes.reaction,
)
.where(
(event) =>
event.senderId == event.room.client.userID &&
event.type == 'm.reaction',
);
for (final event in allReactionEvents) {
try {
emojis.remove(event.content['m.relates_to']['key']);
} catch (_) {}
}
return Row(children: [
Expanded(
child: Container(
for (final event in allReactionEvents) {
try {
emojis.remove(event.content['m.relates_to']['key']);
} catch (_) {}
}
return Row(
children: [
Expanded(
child: Container(
decoration: BoxDecoration(
color: Theme.of(context).secondaryHeaderColor,
borderRadius: const BorderRadius.only(
bottomRight:
Radius.circular(AppConfig.borderRadius))),
color: Theme.of(context).secondaryHeaderColor,
borderRadius: const BorderRadius.only(
bottomRight: Radius.circular(AppConfig.borderRadius),
),
),
padding: const EdgeInsets.only(right: 1),
child: ListView.builder(
scrollDirection: Axis.horizontal,
@ -74,23 +82,28 @@ class ReactionsPicker extends StatelessWidget {
),
),
),
))),
InkWell(
borderRadius: BorderRadius.circular(8),
child: Container(
margin: const EdgeInsets.symmetric(horizontal: 8),
width: 36,
height: 56,
decoration: BoxDecoration(
color: Theme.of(context).secondaryHeaderColor,
shape: BoxShape.circle,
),
),
child: const Icon(Icons.add_outlined),
),
onTap: () =>
controller.pickEmojiReactionAction(allReactionEvents))
]);
}),
InkWell(
borderRadius: BorderRadius.circular(8),
child: Container(
margin: const EdgeInsets.symmetric(horizontal: 8),
width: 36,
height: 56,
decoration: BoxDecoration(
color: Theme.of(context).secondaryHeaderColor,
shape: BoxShape.circle,
),
child: const Icon(Icons.add_outlined),
),
onTap: () =>
controller.pickEmojiReactionAction(allReactionEvents),
)
],
);
},
),
),
);
}