mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-06-25 08:44:08 +00:00
fix typing indicator glitching
This commit is contained in:
parent
7dbd190434
commit
878aca0f12
1 changed files with 50 additions and 36 deletions
|
|
@ -45,6 +45,7 @@ class _TypingIndicatorState extends State<TypingIndicator> {
|
||||||
|
|
||||||
StreamSubscription<List<(Contact, GroupMember)>>? membersSub;
|
StreamSubscription<List<(Contact, GroupMember)>>? membersSub;
|
||||||
Timer? _periodicUpdate;
|
Timer? _periodicUpdate;
|
||||||
|
bool _wasShownOnce = false;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
|
|
@ -79,47 +80,60 @@ class _TypingIndicatorState extends State<TypingIndicator> {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
if (_groupMembers.isEmpty) return Container();
|
if (_groupMembers.isEmpty) {
|
||||||
|
return SizedBox(height: _wasShownOnce ? 19 : 0);
|
||||||
|
} else {
|
||||||
|
_wasShownOnce = true;
|
||||||
|
}
|
||||||
|
|
||||||
return Align(
|
return SizedBox(
|
||||||
alignment: Alignment.centerLeft,
|
height: 19,
|
||||||
child: Padding(
|
child: Align(
|
||||||
padding: const EdgeInsets.all(12),
|
alignment: Alignment.centerLeft,
|
||||||
child: Column(
|
child: Padding(
|
||||||
children: _groupMembers
|
padding: const EdgeInsets.only(left: 12),
|
||||||
.map(
|
child: Row(
|
||||||
(member) => Padding(
|
mainAxisSize: MainAxisSize.min,
|
||||||
key: Key('typing_indicator_${member.contactId}'),
|
children: _groupMembers
|
||||||
padding: const EdgeInsets.symmetric(vertical: 8),
|
.map(
|
||||||
child: Row(
|
(member) => Padding(
|
||||||
mainAxisSize: MainAxisSize.min,
|
key: Key('typing_indicator_${member.contactId}'),
|
||||||
children: [
|
padding: const EdgeInsets.only(right: 8),
|
||||||
if (!widget.group.isDirectChat)
|
child: Row(
|
||||||
GestureDetector(
|
mainAxisSize: MainAxisSize.min,
|
||||||
onTap: () => context.push(
|
children: [
|
||||||
Routes.profileContact(member.contactId),
|
if (!widget.group.isDirectChat)
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(right: 6),
|
||||||
|
child: GestureDetector(
|
||||||
|
onTap: () => context.push(
|
||||||
|
Routes.profileContact(member.contactId),
|
||||||
|
),
|
||||||
|
child: AvatarIcon(
|
||||||
|
contactId: member.contactId,
|
||||||
|
fontSize: 12,
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
child: AvatarIcon(
|
Container(
|
||||||
contactId: member.contactId,
|
padding: const EdgeInsets.symmetric(
|
||||||
fontSize: 12,
|
horizontal: 7,
|
||||||
|
vertical: 6,
|
||||||
|
),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: getMessageColor(true),
|
||||||
|
borderRadius: BorderRadius.circular(12),
|
||||||
|
),
|
||||||
|
child: AnimatedTypingDots(
|
||||||
|
isTyping: isTyping(member),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Container(
|
],
|
||||||
padding: const EdgeInsets.all(8),
|
),
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: getMessageColor(true),
|
|
||||||
borderRadius: BorderRadius.circular(12),
|
|
||||||
),
|
|
||||||
child: AnimatedTypingDots(
|
|
||||||
isTyping: isTyping(member),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Expanded(child: Container()),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
)
|
||||||
)
|
.toList(),
|
||||||
.toList(),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue