import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; ///无数据Widget class EmptyWidget extends StatelessWidget { final Widget? icon; final String? text; const EmptyWidget({super.key, this.text, this.icon}); @override Widget build(BuildContext context) { return Center( child: Row( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.center, children: [ icon == null ? Icon( Icons.sentiment_dissatisfied, size: 35.r, ) : icon!, SizedBox( width: 10.w, ), text == null ? SizedBox() : Text( text!, ) ], ), ); } }