import 'package:flutter/material.dart';
import 'package:widgets/ext/ex_widget.dart';
import '../../utils/dark_theme_util.dart';
import 'package:cs_resources/constants/color_constants.dart';

/// 自定义气泡（吐司）的UI展示
class CustomToastWidget extends StatelessWidget {
  const CustomToastWidget({
    Key? key,
    required this.msg,
    // required this.alignment,
  }) : super(key: key);

  final String msg;

  // final AlignmentGeometry alignment;

  @override
  Widget build(BuildContext context) {
    return Align(
      alignment: Alignment.bottomCenter,
      child: Container(
        margin: const EdgeInsets.symmetric(vertical: 80),
        padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 16),
        decoration: BoxDecoration(
          color: DarkThemeUtil.multiColors(const Color(0XB3000000),darkColor: ColorConstants.darkBlackItem) ,
          borderRadius: BorderRadius.circular(10),
        ),
        child: Text(
          msg,
          style: const TextStyle(color: Colors.white, fontSize: 15),
          textAlign: TextAlign.center,
        ),
      ).constrained(maxWidth: 280),
    );
  }
}
