/* * @Descripttion: * @version: * @Author: wy * @Date: 2020-07-01 15:45:15 * @LastEditors: wangyang 1147192855@qq.com * @LastEditTime: 2022-07-19 11:14:07 */ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; class MyEmptyWidget extends StatelessWidget { static const String defText = "抱歉,暂无内容"; static const String defimg = "assets/images/not_data_bgm.png"; final String? textVal; final String? imgAssetPath; final AlignmentGeometry alignment; final EdgeInsets? padding; final double? imgWidth; final double? imgHeight; const MyEmptyWidget( {this.imgWidth, this.imgHeight, this.textVal, this.padding, this.imgAssetPath, this.alignment = Alignment.center, Key? key}) : super(key: key); @override Widget build(BuildContext context) { return Container( padding: padding, alignment: alignment, child: Column( mainAxisSize: MainAxisSize.min, children: [ Image.asset( imgAssetPath ?? defimg, fit: BoxFit.cover, width: imgWidth ?? 130.w, height: imgHeight ?? 130.w, ), Padding( padding: EdgeInsets.only(top: 15.h), child: Text( textVal ?? defText, style: TextStyle(fontSize: 16.sp, color: Colors.grey), ), ) ], ), ); } }