/* * @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_bgm2.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 != null?padding:EdgeInsets.only(bottom: 40.r), alignment: alignment, child: Column( mainAxisSize: MainAxisSize.min, children: [ Opacity( opacity: 0.6, child: Image.asset( imgAssetPath ?? defimg, fit: BoxFit.cover, width: imgWidth ?? 150.w, height: imgHeight ?? 150.w, ), ), Padding( padding: EdgeInsets.only(top: 5.h), child: Text( textVal ?? defText, style: TextStyle(fontSize: 12.sp, color: Color(0xB2898B8D)), ), ) ], ), ); } }