Optimized channel list

This commit is contained in:
2024-07-06 18:17:54 +08:00
parent cc59814b55
commit 90daff5b97
4 changed files with 92 additions and 84 deletions

View File

@ -247,34 +247,34 @@ class RealmChannelListWidget extends StatelessWidget {
builder: (context, snapshot) {
return RefreshIndicator(
onRefresh: onRefresh,
child: CustomScrollView(
slivers: [
SliverToBoxAdapter(
child: ListTile(
leading: const Icon(Icons.add_box),
contentPadding: const EdgeInsets.only(left: 32, right: 8),
tileColor: Theme.of(context).colorScheme.surfaceContainer,
title: Text('channelNew'.tr),
subtitle: Text(
'channelNewInRealmHint'
.trParams({'realm': '#${realm.alias}'}),
),
onTap: () {
AppRouter.instance
.pushNamed(
'channelOrganizing',
extra: ChannelOrganizeArguments(realm: realm),
)
.then((value) {
if (value != null) onRefresh();
});
},
child: Column(
children: [
ListTile(
leading: const Icon(Icons.add_box),
contentPadding: const EdgeInsets.only(left: 32, right: 8),
tileColor: Theme.of(context).colorScheme.surfaceContainer,
title: Text('channelNew'.tr),
subtitle: Text(
'channelNewInRealmHint'
.trParams({'realm': '#${realm.alias}'}),
),
onTap: () {
AppRouter.instance
.pushNamed(
'channelOrganizing',
extra: ChannelOrganizeArguments(realm: realm),
)
.then((value) {
if (value != null) onRefresh();
});
},
),
ChannelListWidget(
channels: channels,
selfId: snapshot.data?.body['id'] ?? 0,
noCategory: true,
Expanded(
child: ChannelListWidget(
channels: channels,
selfId: snapshot.data?.body['id'] ?? 0,
noCategory: true,
),
)
],
),