show the user the click instruction card when they first see a message

pull/1187/head
ggurdin 1 year ago
parent febf435b9d
commit e5ac6516da

@ -5,6 +5,7 @@ import 'package:fluffychat/pages/chat/seen_by_row.dart';
import 'package:fluffychat/pages/chat/typing_indicators.dart';
import 'package:fluffychat/pages/user_bottom_sheet/user_bottom_sheet.dart';
import 'package:fluffychat/pangea/extensions/pangea_room_extension/pangea_room_extension.dart';
import 'package:fluffychat/pangea/utils/instructions.dart';
import 'package:fluffychat/pangea/widgets/chat/locked_chat_message.dart';
import 'package:fluffychat/utils/account_config.dart';
import 'package:fluffychat/utils/adaptive_bottom_sheet.dart';
@ -40,6 +41,19 @@ class ChatEventList extends StatelessWidget {
final hasWallpaper =
controller.room.client.applicationAccountConfig.wallpaperUrl != null;
// #Pangea
// after the chat event list mounts, if the user hasn't yet seen this instruction
// card, attach it on top of the first shown message
WidgetsBinding.instance.addPostFrameCallback((_) {
controller.pangeaController.instructions.show(
context,
InstructionsEnum.clickMessage,
events[0].eventId,
true,
);
});
// Pangea#
return SelectionArea(
child: ListView.custom(
padding: EdgeInsets.only(

@ -121,13 +121,6 @@ class PangeaRichTextState extends State<PangeaRichText> {
InstructionsEnum.blurMeansTranslate,
widget.pangeaMessageEvent.eventId,
);
} else {
pangeaController.instructions.show(
context,
InstructionsEnum.clickMessage,
widget.pangeaMessageEvent.eventId,
true,
);
}
//TODO - take out of build function of every message

Loading…
Cancel
Save