mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
fix: 搜索结果为null时页面异常
This commit is contained in:
@@ -74,6 +74,7 @@ class _SearchPanelState extends State<SearchPanel>
|
|||||||
future: _futureBuilderFuture,
|
future: _futureBuilderFuture,
|
||||||
builder: (context, snapshot) {
|
builder: (context, snapshot) {
|
||||||
if (snapshot.connectionState == ConnectionState.done) {
|
if (snapshot.connectionState == ConnectionState.done) {
|
||||||
|
if (snapshot.data != null) {
|
||||||
Map data = snapshot.data;
|
Map data = snapshot.data;
|
||||||
var ctr = _searchPanelController;
|
var ctr = _searchPanelController;
|
||||||
RxList list = ctr.resultList;
|
RxList list = ctr.resultList;
|
||||||
@@ -109,6 +110,17 @@ class _SearchPanelState extends State<SearchPanel>
|
|||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
return CustomScrollView(
|
||||||
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
|
slivers: [
|
||||||
|
HttpError(
|
||||||
|
errMsg: '没有相关数据',
|
||||||
|
fn: () => setState(() {}),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// 骨架屏
|
// 骨架屏
|
||||||
return ListView.builder(
|
return ListView.builder(
|
||||||
|
|||||||
Reference in New Issue
Block a user