refactor: Remove unnecessary FutureBuilder

This commit is contained in:
Krille 2024-05-15 08:20:43 +02:00
commit 8a64bdd82d
No known key found for this signature in database
GPG key ID: E067ECD60F1A0652
5 changed files with 76 additions and 129 deletions

View file

@ -66,27 +66,17 @@ class _EditContent extends StatelessWidget {
color: Theme.of(context).colorScheme.primary,
),
Container(width: 15.0),
FutureBuilder<String>(
future: event.calcLocalizedBody(
Text(
event.calcLocalizedBodyFallback(
MatrixLocals(L10n.of(context)!),
withSenderNamePrefix: false,
hideReply: true,
),
builder: (context, snapshot) {
return Text(
snapshot.data ??
event.calcLocalizedBodyFallback(
MatrixLocals(L10n.of(context)!),
withSenderNamePrefix: false,
hideReply: true,
),
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle(
color: Theme.of(context).textTheme.bodyMedium!.color,
),
);
},
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle(
color: Theme.of(context).textTheme.bodyMedium!.color,
),
),
],
);