mirror of
https://github.com/krille-chan/fluffychat
synced 2024-09-17 09:35:12 +00:00
feat: small performance tweaks for Message
It is the widget most often built, so every small bit helps. - replace a List with an array (should be easier to optimize for the compiler) - remove a Padding widget and use the parent Container's padding instead
This commit is contained in:
parent
5aa0f62021
commit
eba3eeee25
1 changed files with 6 additions and 8 deletions
|
@ -75,11 +75,11 @@ class Message extends StatelessWidget {
|
|||
nextEvent == null ||
|
||||
!event.originServerTs.sameEnvironment(nextEvent!.originServerTs);
|
||||
final sameSender = nextEvent != null &&
|
||||
[
|
||||
{
|
||||
EventTypes.Message,
|
||||
EventTypes.Sticker,
|
||||
EventTypes.Encrypted,
|
||||
].contains(nextEvent!.type) &&
|
||||
}.contains(nextEvent!.type) &&
|
||||
nextEvent?.relationshipType == null &&
|
||||
nextEvent!.senderId == event.senderId &&
|
||||
!displayTime;
|
||||
|
@ -407,13 +407,11 @@ class Message extends StatelessWidget {
|
|||
: Theme.of(context).primaryColor.withAlpha(0),
|
||||
constraints:
|
||||
const BoxConstraints(maxWidth: FluffyThemes.columnWidth * 2.5),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 8.0,
|
||||
vertical: 4.0 * AppConfig.bubbleSizeFactor,
|
||||
),
|
||||
child: container,
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 8.0,
|
||||
vertical: 4.0 * AppConfig.bubbleSizeFactor,
|
||||
),
|
||||
child: container,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue