kemptyView function
空页面
list
集合
emptyText
空页面显示文案
emptyImagePath
空页面显示的图片地址
Implementation
Widget kemptyView(
Iterable? list,
Widget child,
String emptyText, {
TextStyle? emptyTextStyle,
String? emptyImagePath,
}) {
if (list != null && list.isNotEmpty) {
return child;
} else {
return Stack(
children: [
Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(emptyImagePath ?? "")
.kshow(emptyImagePath.kisNotBlank()),
SizedBox(height: 30.h).kshow(emptyImagePath.kisNotBlank()),
Text(emptyText, style: emptyTextStyle ?? Font.black_14)
],
),
),
child
],
);
}
}