decent topic
This commit is contained in:
parent
ba9e99a951
commit
d272c20e19
2 changed files with 22 additions and 24 deletions
|
|
@ -5,11 +5,13 @@ class AvatarOrHash extends StatelessWidget {
|
||||||
final Uri? avatar;
|
final Uri? avatar;
|
||||||
final String title;
|
final String title;
|
||||||
final Widget? fallback;
|
final Widget? fallback;
|
||||||
|
final double height;
|
||||||
final Map<String, String> headers;
|
final Map<String, String> headers;
|
||||||
const AvatarOrHash(
|
const AvatarOrHash(
|
||||||
this.avatar,
|
this.avatar,
|
||||||
this.title, {
|
this.title, {
|
||||||
this.fallback,
|
this.fallback,
|
||||||
|
this.height = 24,
|
||||||
required this.headers,
|
required this.headers,
|
||||||
super.key,
|
super.key,
|
||||||
});
|
});
|
||||||
|
|
@ -23,8 +25,7 @@ class AvatarOrHash extends StatelessWidget {
|
||||||
return ClipRRect(
|
return ClipRRect(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(4)),
|
borderRadius: BorderRadius.all(Radius.circular(4)),
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
width: 24,
|
height: height,
|
||||||
height: 24,
|
|
||||||
child: avatar == null
|
child: avatar == null
|
||||||
? fallback ?? box
|
? fallback ?? box
|
||||||
: Image.network(
|
: Image.network(
|
||||||
|
|
|
||||||
|
|
@ -19,30 +19,10 @@ class RoomAppbar extends StatelessWidget implements PreferredSizeWidget {
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Size get preferredSize => Size.fromHeight(AppBar().preferredSize.height + 16);
|
Size get preferredSize => AppBar().preferredSize;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
AppBar build(BuildContext context) => AppBar(
|
AppBar build(BuildContext context) => AppBar(
|
||||||
bottom: PreferredSize(
|
|
||||||
preferredSize: Size.zero, // Does this even matter??
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
child: Padding(
|
|
||||||
padding: EdgeInsets.all(8).copyWith(top: 0),
|
|
||||||
child: Text(
|
|
||||||
room.roomData.topic,
|
|
||||||
maxLines: 1,
|
|
||||||
overflow: TextOverflow.ellipsis,
|
|
||||||
style: Theme.of(context).textTheme.labelMedium?.copyWith(
|
|
||||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
leading: isDesktop ? null : DrawerButton(onPressed: onOpenDrawer),
|
leading: isDesktop ? null : DrawerButton(onPressed: onOpenDrawer),
|
||||||
actionsPadding: EdgeInsets.symmetric(horizontal: 8),
|
actionsPadding: EdgeInsets.symmetric(horizontal: 8),
|
||||||
title: Row(
|
title: Row(
|
||||||
|
|
@ -50,11 +30,28 @@ class RoomAppbar extends StatelessWidget implements PreferredSizeWidget {
|
||||||
AvatarOrHash(
|
AvatarOrHash(
|
||||||
room.avatar,
|
room.avatar,
|
||||||
room.title,
|
room.title,
|
||||||
|
height: 32,
|
||||||
fallback: Icon(Icons.numbers),
|
fallback: Icon(Icons.numbers),
|
||||||
headers: room.roomData.client.headers,
|
headers: room.roomData.client.headers,
|
||||||
),
|
),
|
||||||
SizedBox(width: 12),
|
SizedBox(width: 12),
|
||||||
Expanded(child: Text(room.title, overflow: TextOverflow.ellipsis)),
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(room.title, overflow: TextOverflow.ellipsis),
|
||||||
|
|
||||||
|
Text(
|
||||||
|
room.roomData.topic,
|
||||||
|
maxLines: 1,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
style: Theme.of(context).textTheme.labelMedium?.copyWith(
|
||||||
|
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
actions: [
|
actions: [
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue