mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-24 18:18:38 +00:00
@@ -98,9 +98,7 @@ abstract class CommonDynPageState<T extends CommonDynPage> extends State<T>
|
||||
return switch (loadingState) {
|
||||
Loading() => SliverList.builder(
|
||||
itemCount: 12,
|
||||
itemBuilder: (context, index) {
|
||||
return const VideoReplySkeleton();
|
||||
},
|
||||
itemBuilder: (context, index) => const VideoReplySkeleton(),
|
||||
),
|
||||
Success(:var response) =>
|
||||
response?.isNotEmpty == true
|
||||
@@ -149,7 +147,10 @@ abstract class CommonDynPageState<T extends CommonDynPage> extends State<T>
|
||||
}
|
||||
},
|
||||
)
|
||||
: HttpError(onReload: controller.onReload),
|
||||
: HttpError(
|
||||
errMsg: '还没有评论',
|
||||
onReload: controller.onReload,
|
||||
),
|
||||
Error(:var errMsg) => HttpError(
|
||||
errMsg: errMsg,
|
||||
onReload: controller.onReload,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import 'package:PiliPlus/common/widgets/appbar/appbar.dart';
|
||||
import 'package:PiliPlus/common/widgets/loading_widget/http_error.dart';
|
||||
import 'package:PiliPlus/http/loading_state.dart';
|
||||
import 'package:PiliPlus/pages/common/search/common_search_controller.dart';
|
||||
import 'package:PiliPlus/pages/common/multi_select/base.dart';
|
||||
import 'package:PiliPlus/pages/common/search/common_search_controller.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
@@ -108,9 +108,7 @@ abstract class CommonSearchPageState<S extends CommonSearchPage, R, T>
|
||||
Success(:var response) =>
|
||||
response?.isNotEmpty == true
|
||||
? buildList(response!)
|
||||
: HttpError(
|
||||
onReload: controller.onReload,
|
||||
),
|
||||
: HttpError(onReload: controller.onReload),
|
||||
Error(:var errMsg) => HttpError(
|
||||
errMsg: errMsg,
|
||||
onReload: controller.onReload,
|
||||
|
||||
@@ -9,30 +9,31 @@ abstract class CommonCollapseSlidePageState<T extends CommonCollapseSlidePage>
|
||||
extends CommonSlidePageState<T> {
|
||||
late bool isInit = true;
|
||||
|
||||
void init() {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
isInit = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
init();
|
||||
}
|
||||
|
||||
void init() {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
isInit = false;
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Widget child = super.build(context);
|
||||
if (isInit) {
|
||||
return const CustomScrollView(
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
return Stack(
|
||||
children: [
|
||||
const CustomScrollView(
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
),
|
||||
child,
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
return super.build(context);
|
||||
return child;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user