social_icon.dart 918 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import 'package:flutter/material.dart';
  2. /// Description: 社交icon
  3. /// Time : 05/11/2023 Thursday
  4. /// Author : liuyuqi.gov@msn.cn
  5. class SocialIcon extends StatelessWidget {
  6. /// 颜色
  7. final Color color;
  8. /// 图标
  9. final IconData icon;
  10. /// 点击事件
  11. final Function press;
  12. const SocialIcon(
  13. {super.key,
  14. required this.color,
  15. required this.icon,
  16. required this.press});
  17. @override
  18. Widget build(BuildContext context) {
  19. return Padding(
  20. padding: EdgeInsets.only(left: 14),
  21. child: Container(
  22. width: 45,
  23. height: 45,
  24. decoration: BoxDecoration(shape: BoxShape.circle, color: color),
  25. child: RawMaterialButton(
  26. shape: CircleBorder(),
  27. onPressed: () {
  28. press();
  29. },
  30. child: Icon(
  31. icon,
  32. color: Colors.white,
  33. ),
  34. ),
  35. ),
  36. );
  37. }
  38. }