loading_widget.dart 872 B

1234567891011121314151617181920212223242526272829303132
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter_spinkit/flutter_spinkit.dart';
  3. class LoadingWidget extends StatelessWidget {
  4. const LoadingWidget({Key? key, required this.msg}) : super(key: key);
  5. ///loading msg
  6. final String msg;
  7. @override
  8. Widget build(BuildContext context) {
  9. return Container(
  10. padding: const EdgeInsets.symmetric(horizontal: 30, vertical: 20),
  11. decoration: BoxDecoration(
  12. color: Colors.black,
  13. borderRadius: BorderRadius.circular(15),
  14. ),
  15. child: Column(mainAxisSize: MainAxisSize.min, children: [
  16. //loading animation
  17. const SpinKitCircle(
  18. color: Colors.white,
  19. ),
  20. //msg
  21. Container(
  22. margin: const EdgeInsets.only(top: 20),
  23. child: Text(msg, style: const TextStyle(color: Colors.white)),
  24. ),
  25. ]),
  26. );
  27. }
  28. }