chore: Follow up seen by row
This commit is contained in:
parent
78aeceeb93
commit
127bc6d698
3 changed files with 18 additions and 12 deletions
|
|
@ -8,6 +8,7 @@ import 'package:fluffychat/config/themes.dart';
|
||||||
import 'package:fluffychat/l10n/l10n.dart';
|
import 'package:fluffychat/l10n/l10n.dart';
|
||||||
import 'package:fluffychat/pages/chat/chat.dart';
|
import 'package:fluffychat/pages/chat/chat.dart';
|
||||||
import 'package:fluffychat/pages/chat/events/message.dart';
|
import 'package:fluffychat/pages/chat/events/message.dart';
|
||||||
|
import 'package:fluffychat/pages/chat/seen_by_row.dart';
|
||||||
import 'package:fluffychat/pages/chat/typing_indicators.dart';
|
import 'package:fluffychat/pages/chat/typing_indicators.dart';
|
||||||
import 'package:fluffychat/utils/account_config.dart';
|
import 'package:fluffychat/utils/account_config.dart';
|
||||||
import 'package:fluffychat/utils/matrix_sdk_extensions/filtered_timeline_extension.dart';
|
import 'package:fluffychat/utils/matrix_sdk_extensions/filtered_timeline_extension.dart';
|
||||||
|
|
@ -76,7 +77,13 @@ class ChatEventList extends StatelessWidget {
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return TypingIndicators(controller);
|
return Column(
|
||||||
|
mainAxisSize: .min,
|
||||||
|
children: [
|
||||||
|
SeenByRow(event: events.first),
|
||||||
|
TypingIndicators(controller),
|
||||||
|
],
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request history button or progress indicator:
|
// Request history button or progress indicator:
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@ import 'package:swipe_to_action/swipe_to_action.dart';
|
||||||
import 'package:fluffychat/config/setting_keys.dart';
|
import 'package:fluffychat/config/setting_keys.dart';
|
||||||
import 'package:fluffychat/config/themes.dart';
|
import 'package:fluffychat/config/themes.dart';
|
||||||
import 'package:fluffychat/l10n/l10n.dart';
|
import 'package:fluffychat/l10n/l10n.dart';
|
||||||
import 'package:fluffychat/pages/chat/seen_by_row.dart';
|
|
||||||
import 'package:fluffychat/utils/adaptive_bottom_sheet.dart';
|
import 'package:fluffychat/utils/adaptive_bottom_sheet.dart';
|
||||||
import 'package:fluffychat/utils/date_time_extension.dart';
|
import 'package:fluffychat/utils/date_time_extension.dart';
|
||||||
import 'package:fluffychat/utils/file_description.dart';
|
import 'package:fluffychat/utils/file_description.dart';
|
||||||
|
|
@ -858,7 +857,6 @@ class Message extends StatelessWidget {
|
||||||
child: MessageReactions(event, timeline),
|
child: MessageReactions(event, timeline),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SeenByRow(timeline: timeline, event: event),
|
|
||||||
if (enterThread != null)
|
if (enterThread != null)
|
||||||
AnimatedSize(
|
AnimatedSize(
|
||||||
duration: FluffyThemes.animationDuration,
|
duration: FluffyThemes.animationDuration,
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,8 @@ import 'package:fluffychat/widgets/avatar.dart';
|
||||||
import 'package:fluffychat/widgets/matrix.dart';
|
import 'package:fluffychat/widgets/matrix.dart';
|
||||||
|
|
||||||
class SeenByRow extends StatelessWidget {
|
class SeenByRow extends StatelessWidget {
|
||||||
final Timeline timeline;
|
|
||||||
final Event event;
|
final Event event;
|
||||||
const SeenByRow({super.key, required this.timeline, required this.event});
|
const SeenByRow({super.key, required this.event});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
|
@ -17,9 +16,9 @@ class SeenByRow extends StatelessWidget {
|
||||||
|
|
||||||
const maxAvatars = 7;
|
const maxAvatars = 7;
|
||||||
return StreamBuilder(
|
return StreamBuilder(
|
||||||
stream: timeline.room.client.onSync.stream.where(
|
stream: event.room.client.onSync.stream.where(
|
||||||
(syncUpdate) =>
|
(syncUpdate) =>
|
||||||
syncUpdate.rooms?.join?[timeline.room.id]?.ephemeral?.any(
|
syncUpdate.rooms?.join?[event.room.id]?.ephemeral?.any(
|
||||||
(ephemeral) => ephemeral.type == 'm.receipt',
|
(ephemeral) => ephemeral.type == 'm.receipt',
|
||||||
) ??
|
) ??
|
||||||
false,
|
false,
|
||||||
|
|
@ -38,13 +37,15 @@ class SeenByRow extends StatelessWidget {
|
||||||
? Duration.zero
|
? Duration.zero
|
||||||
: FluffyThemes.animationDuration,
|
: FluffyThemes.animationDuration,
|
||||||
curve: FluffyThemes.animationCurve,
|
curve: FluffyThemes.animationCurve,
|
||||||
alignment:
|
alignment: event.senderId == Matrix.of(context).client.userID
|
||||||
timeline.events.isNotEmpty &&
|
|
||||||
timeline.events.first.senderId ==
|
|
||||||
Matrix.of(context).client.userID
|
|
||||||
? Alignment.topRight
|
? Alignment.topRight
|
||||||
: Alignment.topLeft,
|
: Alignment.topLeft,
|
||||||
padding: const EdgeInsets.only(bottom: 4, top: 1),
|
padding: const EdgeInsets.only(
|
||||||
|
bottom: 4,
|
||||||
|
top: 1,
|
||||||
|
left: 8,
|
||||||
|
right: 8,
|
||||||
|
),
|
||||||
child: Wrap(
|
child: Wrap(
|
||||||
spacing: 4,
|
spacing: 4,
|
||||||
children: [
|
children: [
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue