import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; ///加载Widget class LoadingWidget extends StatelessWidget { final Widget? icon; final String? text; const LoadingWidget({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.downloading, size: 35.r, ) : icon!, SizedBox( width: 10.w, ), text == null ? SizedBox() : Text( text!, ) ], ), ); } }