chore: Follow up pinned events

This commit is contained in:
krille-chan 2024-07-26 18:07:54 +02:00
commit 8128c960dc
No known key found for this signature in database
3 changed files with 37 additions and 34 deletions

View file

@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
import 'package:flutter_linkify/flutter_linkify.dart';
import 'package:fluffychat/config/app_config.dart';
import 'package:fluffychat/utils/url_launcher.dart';
class ChatAppBarListTile extends StatelessWidget {
@ -11,6 +10,8 @@ class ChatAppBarListTile extends StatelessWidget {
final Widget? trailing;
final void Function()? onTap;
static const double fixedHeight = 40.0;
const ChatAppBarListTile({
super.key,
this.leading,
@ -23,8 +24,9 @@ class ChatAppBarListTile extends StatelessWidget {
Widget build(BuildContext context) {
final leading = this.leading;
final trailing = this.trailing;
final fontSize = AppConfig.messageFontSize * AppConfig.fontSizeFactor;
return InkWell(
return SizedBox(
height: fixedHeight,
child: InkWell(
onTap: onTap,
child: Row(
children: [
@ -40,11 +42,11 @@ class ChatAppBarListTile extends StatelessWidget {
style: TextStyle(
color: Theme.of(context).colorScheme.onSurfaceVariant,
overflow: TextOverflow.ellipsis,
fontSize: fontSize,
fontSize: 14,
),
linkStyle: TextStyle(
color: Theme.of(context).colorScheme.onSurfaceVariant,
fontSize: fontSize,
fontSize: 14,
decoration: TextDecoration.underline,
decorationColor:
Theme.of(context).colorScheme.onSurfaceVariant,
@ -56,6 +58,7 @@ class ChatAppBarListTile extends StatelessWidget {
if (trailing != null) trailing,
],
),
),
);
}
}

View file

@ -158,15 +158,15 @@ class ChatView extends StatelessWidget {
builder: (BuildContext context, snapshot) {
var appbarBottomHeight = 0.0;
if (controller.room.pinnedEventIds.isNotEmpty) {
appbarBottomHeight += 42;
appbarBottomHeight += ChatAppBarListTile.fixedHeight;
}
if (scrollUpBannerEventId != null) {
appbarBottomHeight += 42;
appbarBottomHeight += ChatAppBarListTile.fixedHeight;
}
final tombstoneEvent =
controller.room.getState(EventTypes.RoomTombstone);
if (tombstoneEvent != null) {
appbarBottomHeight += 42;
appbarBottomHeight += ChatAppBarListTile.fixedHeight;
}
return Scaffold(
appBar: AppBar(

View file

@ -71,8 +71,8 @@ class PinnedEvents extends StatelessWidget {
) ??
L10n.of(context)!.loadingPleaseWait,
leading: IconButton(
splashRadius: 20,
iconSize: 20,
splashRadius: 18,
iconSize: 18,
color: Theme.of(context).colorScheme.onSurfaceVariant,
icon: const Icon(Icons.push_pin),
tooltip: L10n.of(context)!.unpin,