chore: prefer final and lazy init

This commit is contained in:
Gordon Hayes
2022-10-07 11:25:49 +02:00
parent b193e5a8c6
commit 5ce982a181
9 changed files with 72 additions and 78 deletions
@@ -164,7 +164,7 @@ class MyChannelPreview extends StatelessWidget {
String stringDate;
final now = DateTime.now();
var startOfDay = DateTime(now.year, now.month, now.day);
final startOfDay = DateTime(now.year, now.month, now.day);
if (lastMessageAt.millisecondsSinceEpoch >=
startOfDay.millisecondsSinceEpoch) {
@@ -300,9 +300,9 @@ class MyChannelPreview extends StatelessWidget {
List<Attachment> attachments,
TextStyle normalTextStyle,
TextStyle mentionsTextStyle) {
var textList = text.split(' ');
var resList = <TextSpan>[];
for (var e in textList) {
final textList = text.split(' ');
final resList = <TextSpan>[];
for (final e in textList) {
if (mentions.isNotEmpty &&
mentions.any((element) => '@${element.name}' == e)) {
resList.add(TextSpan(