loading_widget.dart 830 B

12345678910111213141516171819202122232425262728293031323334353637
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter_screenutil/flutter_screenutil.dart';
  3. ///加载Widget
  4. class LoadingWidget extends StatelessWidget {
  5. final Widget? icon;
  6. final String? text;
  7. const LoadingWidget({super.key, this.text, this.icon});
  8. @override
  9. Widget build(BuildContext context) {
  10. return Center(
  11. child: Row(
  12. mainAxisSize: MainAxisSize.min,
  13. crossAxisAlignment: CrossAxisAlignment.center,
  14. children: [
  15. icon == null
  16. ? Icon(
  17. Icons.downloading,
  18. size: 35.r,
  19. )
  20. : icon!,
  21. SizedBox(
  22. width: 10.w,
  23. ),
  24. text == null
  25. ? SizedBox()
  26. : Text(
  27. text!,
  28. )
  29. ],
  30. ),
  31. );
  32. }
  33. }