mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2025-01-23 10:34:25 +01:00
fix: Properly re-render the timeline etc. when the full userinformation was fetched
This commit is contained in:
parent
4a92787feb
commit
f4c527a933
@ -63,7 +63,10 @@ class ChatView extends StatelessWidget {
|
||||
redirector.stopRedirection();
|
||||
}
|
||||
},
|
||||
child: Scaffold(
|
||||
child: StreamBuilder(
|
||||
stream: controller.room.onUpdate.stream
|
||||
.rateLimit(Duration(milliseconds: 250)),
|
||||
builder: (context, snapshot) => Scaffold(
|
||||
appBar: AppBar(
|
||||
actionsIconTheme: IconThemeData(
|
||||
color: controller.selectedEvents.isEmpty
|
||||
@ -80,12 +83,9 @@ class ChatView extends StatelessWidget {
|
||||
: UnreadBadgeBackButton(roomId: controller.roomId),
|
||||
titleSpacing: 0,
|
||||
title: controller.selectedEvents.isEmpty
|
||||
? StreamBuilder(
|
||||
stream: controller.room.onUpdate.stream
|
||||
.rateLimit(Duration(milliseconds: 250)),
|
||||
builder: (context, snapshot) => ListTile(
|
||||
leading: Avatar(controller.room.avatar,
|
||||
controller.room.displayname),
|
||||
? ListTile(
|
||||
leading: Avatar(
|
||||
controller.room.avatar, controller.room.displayname),
|
||||
contentPadding: EdgeInsets.zero,
|
||||
onTap: controller.room.isDirectChat
|
||||
? () => showModalBottomSheet(
|
||||
@ -118,17 +118,15 @@ class ChatView extends StatelessWidget {
|
||||
controller.room.directChatMatrixID)
|
||||
.rateLimit(Duration(seconds: 1)),
|
||||
builder: (context, snapshot) => Text(
|
||||
controller.room
|
||||
.getLocalizedStatus(context),
|
||||
controller.room.getLocalizedStatus(context),
|
||||
maxLines: 1,
|
||||
//overflow: TextOverflow.ellipsis,
|
||||
))
|
||||
: Row(
|
||||
children: <Widget>[
|
||||
Icon(Icons.edit_outlined,
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.secondary,
|
||||
color:
|
||||
Theme.of(context).colorScheme.secondary,
|
||||
size: 13),
|
||||
SizedBox(width: 4),
|
||||
Expanded(
|
||||
@ -137,16 +135,15 @@ class ChatView extends StatelessWidget {
|
||||
.getLocalizedTypingText(context),
|
||||
maxLines: 1,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.secondary,
|
||||
color:
|
||||
Theme.of(context).colorScheme.secondary,
|
||||
fontStyle: FontStyle.italic,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
))
|
||||
)
|
||||
: Text(controller.selectedEvents.length.toString()),
|
||||
actions: controller.selectMode
|
||||
? <Widget>[
|
||||
@ -260,6 +257,13 @@ class ChatView extends StatelessWidget {
|
||||
thisEventsKeyMap[
|
||||
controller.filteredEvents[i].eventId] = i;
|
||||
}
|
||||
final seenByText =
|
||||
controller.room.getLocalizedSeenByText(
|
||||
context,
|
||||
controller.timeline,
|
||||
controller.filteredEvents,
|
||||
controller.unfolded,
|
||||
);
|
||||
|
||||
return ListView.custom(
|
||||
padding: EdgeInsets.only(
|
||||
@ -287,33 +291,15 @@ class ChatView extends StatelessWidget {
|
||||
)
|
||||
: Container()
|
||||
: i == 0
|
||||
? StreamBuilder(
|
||||
stream: controller
|
||||
.room.onUpdate.stream
|
||||
.rateLimit(Duration(
|
||||
milliseconds: 250)),
|
||||
builder: (_, __) {
|
||||
final seenByText = controller.room
|
||||
.getLocalizedSeenByText(
|
||||
context,
|
||||
controller.timeline,
|
||||
controller.filteredEvents,
|
||||
controller.unfolded,
|
||||
);
|
||||
return AnimatedContainer(
|
||||
height:
|
||||
seenByText.isEmpty ? 0 : 24,
|
||||
? AnimatedContainer(
|
||||
height: seenByText.isEmpty ? 0 : 24,
|
||||
duration: seenByText.isEmpty
|
||||
? Duration(milliseconds: 0)
|
||||
: Duration(
|
||||
milliseconds: 300),
|
||||
alignment: controller
|
||||
.filteredEvents
|
||||
: Duration(milliseconds: 300),
|
||||
alignment: controller.filteredEvents
|
||||
.isNotEmpty &&
|
||||
controller
|
||||
.filteredEvents
|
||||
.first
|
||||
.senderId ==
|
||||
controller.filteredEvents
|
||||
.first.senderId ==
|
||||
client.userID
|
||||
? Alignment.topRight
|
||||
: Alignment.topLeft,
|
||||
@ -330,14 +316,12 @@ class ChatView extends StatelessWidget {
|
||||
.scaffoldBackgroundColor
|
||||
.withOpacity(0.8),
|
||||
borderRadius:
|
||||
BorderRadius.circular(
|
||||
4),
|
||||
BorderRadius.circular(4),
|
||||
),
|
||||
child: Text(
|
||||
seenByText,
|
||||
maxLines: 1,
|
||||
overflow:
|
||||
TextOverflow.ellipsis,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
@ -345,8 +329,6 @@ class ChatView extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
)
|
||||
: AutoScrollTag(
|
||||
key: ValueKey(controller
|
||||
@ -764,7 +746,9 @@ class ChatView extends StatelessWidget {
|
||||
),
|
||||
],
|
||||
),
|
||||
));
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user