mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2025-02-07 02:34:17 +01:00
fix: re-enable chat list animation
Signed-off-by: TheOneWithTheBraid <the-one@with-the-braid.cf>
This commit is contained in:
parent
7cdeb98671
commit
478634cb99
@ -17,6 +17,7 @@ import '../../widgets/connection_status_header.dart';
|
|||||||
import '../../widgets/matrix.dart';
|
import '../../widgets/matrix.dart';
|
||||||
|
|
||||||
class ChatListViewBody extends StatelessWidget {
|
class ChatListViewBody extends StatelessWidget {
|
||||||
|
static final _transitionSwitcherKey = GlobalKey();
|
||||||
final ChatListController controller;
|
final ChatListController controller;
|
||||||
|
|
||||||
const ChatListViewBody(this.controller, {Key? key}) : super(key: key);
|
const ChatListViewBody(this.controller, {Key? key}) : super(key: key);
|
||||||
@ -28,6 +29,7 @@ class ChatListViewBody extends StatelessWidget {
|
|||||||
final client = Matrix.of(context).client;
|
final client = Matrix.of(context).client;
|
||||||
|
|
||||||
return PageTransitionSwitcher(
|
return PageTransitionSwitcher(
|
||||||
|
key: _transitionSwitcherKey,
|
||||||
transitionBuilder: (
|
transitionBuilder: (
|
||||||
Widget child,
|
Widget child,
|
||||||
Animation<double> primaryAnimation,
|
Animation<double> primaryAnimation,
|
||||||
@ -41,13 +43,18 @@ class ChatListViewBody extends StatelessWidget {
|
|||||||
child: child,
|
child: child,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
child: Builder(builder: (context) {
|
child: Builder(
|
||||||
|
key: ValueKey(
|
||||||
|
controller.activeFilter != ActiveFilter.spaces
|
||||||
|
? controller.activeFilter
|
||||||
|
: controller.activeSpaceId ?? controller.activeFilter,
|
||||||
|
),
|
||||||
|
builder: (context) {
|
||||||
if (controller.activeFilter == ActiveFilter.spaces &&
|
if (controller.activeFilter == ActiveFilter.spaces &&
|
||||||
!controller.isSearchMode) {
|
!controller.isSearchMode) {
|
||||||
return SpaceView(
|
return SpaceView(
|
||||||
controller,
|
controller,
|
||||||
scrollController: controller.scrollController,
|
scrollController: controller.scrollController,
|
||||||
key: Key(controller.activeSpaceId ?? 'Spaces'),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (controller.waitForFirstSync && client.prevBatch != null) {
|
if (controller.waitForFirstSync && client.prevBatch != null) {
|
||||||
@ -87,8 +94,8 @@ class ChatListViewBody extends StatelessWidget {
|
|||||||
onPressed: () => showModalBottomSheet(
|
onPressed: () => showModalBottomSheet(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (c) => PublicRoomBottomSheet(
|
builder: (c) => PublicRoomBottomSheet(
|
||||||
roomAlias:
|
roomAlias: roomSearchResult
|
||||||
roomSearchResult.chunk[i].canonicalAlias ??
|
.chunk[i].canonicalAlias ??
|
||||||
roomSearchResult.chunk[i].roomId,
|
roomSearchResult.chunk[i].roomId,
|
||||||
outerContext: context,
|
outerContext: context,
|
||||||
chunk: roomSearchResult.chunk[i],
|
chunk: roomSearchResult.chunk[i],
|
||||||
@ -113,7 +120,8 @@ class ChatListViewBody extends StatelessWidget {
|
|||||||
itemCount: userSearchResult.results.length,
|
itemCount: userSearchResult.results.length,
|
||||||
itemBuilder: (context, i) => _SearchItem(
|
itemBuilder: (context, i) => _SearchItem(
|
||||||
title: userSearchResult.results[i].displayName ??
|
title: userSearchResult.results[i].displayName ??
|
||||||
userSearchResult.results[i].userId.localpart ??
|
userSearchResult
|
||||||
|
.results[i].userId.localpart ??
|
||||||
L10n.of(context)!.unknownDevice,
|
L10n.of(context)!.unknownDevice,
|
||||||
avatar: userSearchResult.results[i].avatarUrl,
|
avatar: userSearchResult.results[i].avatarUrl,
|
||||||
onPressed: () => showModalBottomSheet(
|
onPressed: () => showModalBottomSheet(
|
||||||
@ -172,7 +180,8 @@ class ChatListViewBody extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
Divider(
|
Divider(
|
||||||
height: 1,
|
height: 1,
|
||||||
color: Theme.of(context).colorScheme.onBackground,
|
color:
|
||||||
|
Theme.of(context).colorScheme.onBackground,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 32),
|
const SizedBox(height: 32),
|
||||||
FloatingActionButton.extended(
|
FloatingActionButton.extended(
|
||||||
@ -217,7 +226,6 @@ class ChatListViewBody extends StatelessWidget {
|
|||||||
final subtitleColor =
|
final subtitleColor =
|
||||||
Theme.of(context).textTheme.bodyText1!.color!.withAlpha(50);
|
Theme.of(context).textTheme.bodyText1!.color!.withAlpha(50);
|
||||||
return ListView.builder(
|
return ListView.builder(
|
||||||
key: const Key('dummychats'),
|
|
||||||
itemCount: dummyChatCount,
|
itemCount: dummyChatCount,
|
||||||
itemBuilder: (context, i) => Opacity(
|
itemBuilder: (context, i) => Opacity(
|
||||||
opacity: (dummyChatCount - i) / dummyChatCount,
|
opacity: (dummyChatCount - i) / dummyChatCount,
|
||||||
@ -271,7 +279,8 @@ class ChatListViewBody extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}),
|
},
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user