Skip to content

Commit

Permalink
ui improvments
Browse files Browse the repository at this point in the history
  • Loading branch information
Airyzz committed Jul 3, 2024
1 parent d93d68e commit 9ec83e6
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 45 deletions.
63 changes: 32 additions & 31 deletions commet/lib/ui/atoms/space_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -80,36 +80,35 @@ class _SpaceListState extends State<SpaceList> {

@override
Widget build(BuildContext context) {
return SingleChildScrollView(
child: Column(
children: [
if (subSpaces.isNotEmpty)
Padding(
padding: const EdgeInsets.fromLTRB(0, 12, 0, 0),
child: ImplicitlyAnimatedList(
itemData: subSpaces,
shrinkWrap: true,
initialAnimation: false,
itemBuilder: (context, data) {
return tiamat.TextButtonExpander(data.displayName,
initiallyExpanded: true,
iconColor: Theme.of(context).colorScheme.secondary,
textColor: Theme.of(context).colorScheme.secondary,
icon: Icons.format_list_bulleted,
children: [
Padding(
padding: const EdgeInsets.fromLTRB(0, 0, 0, 8),
child: SpaceList(
data,
onRoomSelected: widget.onRoomSelected,
),
)
]);
},
)),
if (widget.space.rooms.isNotEmpty) roomsList()
],
),
return Column(
children: [
if (subSpaces.isNotEmpty)
Padding(
padding: const EdgeInsets.fromLTRB(0, 12, 0, 0),
child: ImplicitlyAnimatedList(
itemData: subSpaces,
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
padding: const EdgeInsets.all(0),
initialAnimation: false,
itemBuilder: (context, data) {
return tiamat.TextButtonExpander(data.displayName,
initiallyExpanded: true,
iconColor: Theme.of(context).colorScheme.secondary,
textColor: Theme.of(context).colorScheme.secondary,
children: [
Padding(
padding: const EdgeInsets.fromLTRB(0, 0, 0, 8),
child: SpaceList(
data,
onRoomSelected: widget.onRoomSelected,
),
)
]);
},
)),
if (widget.space.rooms.isNotEmpty) roomsList()
],
);
}

Expand All @@ -133,11 +132,13 @@ class _SpaceListState extends State<SpaceList> {
Widget buildRoomsList() {
return ImplicitlyAnimatedList(
itemData: widget.space.rooms,
physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true,
padding: const EdgeInsets.all(0),
initialAnimation: false,
itemBuilder: (context, data) {
return SizedBox(
height: 30,
height: 37,
child: RoomTextButton(
data,
onTap: widget.onRoomSelected,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ class SpaceSummaryViewState extends State<SpaceSummaryView> {
ListView.builder(
shrinkWrap: true,
itemCount: widget.spaces!.length,
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (context, index) {
var space = widget.spaces![index];
return RoomPanel(
Expand Down
24 changes: 10 additions & 14 deletions commet/lib/ui/pages/main/main_page_view_mobile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -336,20 +336,16 @@ class _MainPageViewMobileState extends State<MainPageViewMobile> {
onTap: clearSelectedRoom,
),
Expanded(
child: Padding(
padding: const EdgeInsets.fromLTRB(0, 0, 0, 0),
child: SpaceViewer(
widget.state.currentSpace!,
key: ValueKey(
"space-view-key-${widget.state.currentSpace!.localId}"),
onChildAdded: widget.state.clientManager.onSpaceAdded,
onChildRemoved: widget.state.clientManager.onSpaceRemoved,
onChildUpdated:
widget.state.clientManager.onSpaceUpdated.stream,
onRoomSelected: (room) async {
selectRoom(room);
},
),
child: SpaceViewer(
widget.state.currentSpace!,
key: ValueKey(
"space-view-key-${widget.state.currentSpace!.localId}"),
onChildAdded: widget.state.clientManager.onSpaceAdded,
onChildRemoved: widget.state.clientManager.onSpaceRemoved,
onChildUpdated: widget.state.clientManager.onSpaceUpdated.stream,
onRoomSelected: (room) async {
selectRoom(room);
},
)),
],
),
Expand Down

0 comments on commit 9ec83e6

Please sign in to comment.