💄 Optimize unauthorized status

This commit is contained in:
2026-01-02 14:33:41 +08:00
parent 3b13a63e7b
commit 800815c721
4 changed files with 84 additions and 34 deletions

View File

@@ -603,11 +603,13 @@ class ChatListScreen extends HookConsumerWidget {
),
),
),
body: ChatListBodyWidget(
isFloating: false,
tabController: tabController,
selectedTab: selectedTab,
),
body: userInfo.value == null
? const ResponseUnauthorizedWidget()
: ChatListBodyWidget(
isFloating: false,
tabController: tabController,
selectedTab: selectedTab,
),
);
}
}

View File

@@ -121,36 +121,38 @@ class RealmListScreen extends HookConsumerWidget {
MediaQuery.of(context).padding.bottom,
)
: null,
body: ExtendedRefreshIndicator(
child: realms.when(
data: (value) => Column(
children: [
Expanded(
child: ListView.separated(
padding: EdgeInsets.only(
top: 8,
bottom: MediaQuery.of(context).padding.bottom + 8,
),
itemCount: value.length,
itemBuilder: (context, item) {
return ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 540),
child: RealmListTile(realm: value[item]),
).padding(horizontal: 8).center();
},
separatorBuilder: (_, _) => const Gap(8),
body: userInfo.value == null
? const ResponseUnauthorizedWidget()
: ExtendedRefreshIndicator(
child: realms.when(
data: (value) => Column(
children: [
Expanded(
child: ListView.separated(
padding: EdgeInsets.only(
top: 8,
bottom: MediaQuery.of(context).padding.bottom + 8,
),
itemCount: value.length,
itemBuilder: (context, item) {
return ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 540),
child: RealmListTile(realm: value[item]),
).padding(horizontal: 8).center();
},
separatorBuilder: (_, _) => const Gap(8),
),
),
],
),
loading: () => const Center(child: CircularProgressIndicator()),
error: (e, _) => ResponseErrorWidget(
error: e,
onRetry: () => ref.invalidate(realmsJoinedProvider),
),
),
],
),
loading: () => const Center(child: CircularProgressIndicator()),
error: (e, _) => ResponseErrorWidget(
error: e,
onRetry: () => ref.invalidate(realmsJoinedProvider),
),
),
onRefresh: () => ref.refresh(realmsJoinedProvider.future),
),
onRefresh: () => ref.refresh(realmsJoinedProvider.future),
),
);
}
}