custom_toast_widget.dart 831 B

123456789101112131415161718192021222324252627282930
  1. import 'package:flutter/material.dart';
  2. /// 自定义气泡(吐司)的UI展示
  3. class CustomToastWidget extends StatelessWidget {
  4. const CustomToastWidget({
  5. Key? key,
  6. required this.msg,
  7. // required this.alignment,
  8. }) : super(key: key);
  9. final String msg;
  10. // final AlignmentGeometry alignment;
  11. @override
  12. Widget build(BuildContext context) {
  13. return Align(
  14. alignment: Alignment.bottomCenter,
  15. child: Container(
  16. margin: const EdgeInsets.symmetric(vertical: 80),
  17. padding: const EdgeInsets.symmetric(horizontal: 25, vertical: 12),
  18. decoration: BoxDecoration(
  19. color: const Color(0xcc000000),
  20. borderRadius: BorderRadius.circular(18),
  21. ),
  22. child: Text(msg, style: const TextStyle(color: Colors.white,fontSize: 15.5)),
  23. ),
  24. );
  25. }
  26. }