add slight padding above browse space fab
This commit is contained in:
parent
ab3eda0beb
commit
659e76b8f8
1 changed files with 68 additions and 62 deletions
|
|
@ -284,75 +284,81 @@ class const RoomsPane({super.key}) extends ConsumerWidget {
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
child: NavigationRailM3E(
|
child: Padding(
|
||||||
fab: selectedSpace.room == null
|
padding: const .only(top: 4),
|
||||||
? null
|
child: NavigationRailM3E(
|
||||||
: .new(
|
fab: selectedSpace.room == null
|
||||||
icon: const Icon(Icons.explore),
|
? null
|
||||||
label: "Browse space",
|
: .new(
|
||||||
tooltip: "Browse and join rooms in this space",
|
icon: const Icon(Icons.explore),
|
||||||
onPressed: () => context.showAdaptiveSheet(
|
label: "Browse space",
|
||||||
(_) => SpaceHierarchySheet(selectedSpace.id),
|
tooltip: "Browse and join rooms in this space",
|
||||||
|
onPressed: () => context.showAdaptiveSheet(
|
||||||
|
(_) => SpaceHierarchySheet(selectedSpace.id),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
expandedWidth: double.infinity,
|
||||||
expandedWidth: double.infinity,
|
scrollable: true,
|
||||||
scrollable: true,
|
background: Colors.transparent,
|
||||||
background: Colors.transparent,
|
type: .alwaysExpand,
|
||||||
type: .alwaysExpand,
|
selectedIndex: max(
|
||||||
selectedIndex: max(
|
0,
|
||||||
0,
|
selectedSpace.allChildRooms.indexWhere(
|
||||||
selectedSpace.allChildRooms.indexWhere(
|
(room) => room.metadata?.id == selectedRoomId,
|
||||||
(room) => room.metadata?.id == selectedRoomId,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
sections: [
|
|
||||||
.new(
|
|
||||||
header: selectedSpace.room == null
|
|
||||||
? null
|
|
||||||
: const DividerWidget(Text("Rooms")),
|
|
||||||
destinations: selectedSpace.children.toDestinations(
|
|
||||||
isDm: isDm,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
...selectedSpace.subSpaces.map(
|
sections: [
|
||||||
(subSpace) => NavigationRailM3ESection(
|
.new(
|
||||||
header: DividerWidget(
|
header: selectedSpace.room == null
|
||||||
Row(
|
? null
|
||||||
mainAxisSize: .min,
|
: const DividerWidget(Text("Rooms")),
|
||||||
spacing: 8,
|
destinations: selectedSpace.children.toDestinations(
|
||||||
children: [
|
|
||||||
if (subSpace.room.metadata?.avatar != null)
|
|
||||||
AvatarOrHash(
|
|
||||||
subSpace.room.metadata?.avatar,
|
|
||||||
subSpace.room.metadata?.name ?? "Unnamed Room",
|
|
||||||
dimension: 16,
|
|
||||||
),
|
|
||||||
Flexible(
|
|
||||||
child: Text(
|
|
||||||
subSpace.room.metadata?.name ?? "Unnamed Space",
|
|
||||||
maxLines: 1,
|
|
||||||
overflow: .ellipsis,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
destinations: subSpace.children.toDestinations(
|
|
||||||
isDm: isDm,
|
isDm: isDm,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
...selectedSpace.subSpaces.map(
|
||||||
],
|
(subSpace) => NavigationRailM3ESection(
|
||||||
onDestinationSelected: (value) {
|
header: DividerWidget(
|
||||||
ref
|
Row(
|
||||||
.read(
|
mainAxisSize: .min,
|
||||||
KeyController.provider(KeyController.roomKey).notifier,
|
spacing: 8,
|
||||||
)
|
children: [
|
||||||
.set(selectedSpace.allChildRooms[value].metadata?.id);
|
if (subSpace.room.metadata?.avatar != null)
|
||||||
if (Navigator.of(context).canPop()) {
|
AvatarOrHash(
|
||||||
Navigator.of(context).pop();
|
subSpace.room.metadata?.avatar,
|
||||||
}
|
subSpace.room.metadata?.name ??
|
||||||
},
|
"Unnamed Room",
|
||||||
|
dimension: 16,
|
||||||
|
),
|
||||||
|
Flexible(
|
||||||
|
child: Text(
|
||||||
|
subSpace.room.metadata?.name ??
|
||||||
|
"Unnamed Space",
|
||||||
|
maxLines: 1,
|
||||||
|
overflow: .ellipsis,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
destinations: subSpace.children.toDestinations(
|
||||||
|
isDm: isDm,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
onDestinationSelected: (value) {
|
||||||
|
ref
|
||||||
|
.read(
|
||||||
|
KeyController.provider(KeyController.roomKey)
|
||||||
|
.notifier,
|
||||||
|
)
|
||||||
|
.set(selectedSpace.allChildRooms[value].metadata?.id);
|
||||||
|
if (Navigator.of(context).canPop()) {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue