forked from Nexus/nexus
show topics and summaries for spaces
This commit is contained in:
parent
b71a7f0bd6
commit
ab3eda0beb
6 changed files with 60 additions and 38 deletions
22
lib/widgets/room_title.dart
Normal file
22
lib/widgets/room_title.dart
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import "package:material_ui/material_ui.dart";
|
||||
|
||||
/// A room or space's name, with its topic underneath if it has one, for app
|
||||
/// bars.
|
||||
class const RoomTitle(final String name, {final String? topic, super.key})
|
||||
extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) => Column(
|
||||
crossAxisAlignment: .start,
|
||||
children: [
|
||||
Text(name, overflow: .ellipsis, maxLines: 1),
|
||||
if (topic?.isNotEmpty == true)
|
||||
Text(
|
||||
topic!,
|
||||
maxLines: 1,
|
||||
overflow: .ellipsis,
|
||||
style: Theme.of(context).textTheme.labelMedium
|
||||
?.copyWith(color: Theme.of(context).colorScheme.onSurfaceVariant),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
Loading…
Reference in a new issue