notification_warning_widget.dart 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. import 'package:flutter/material.dart';
  2. import 'package:photos/ente_theme_data.dart';
  3. import 'package:photos/theme/colors.dart';
  4. import 'package:photos/theme/text_style.dart';
  5. class NotificationWarningWidget extends StatelessWidget {
  6. final IconData warningIcon;
  7. final IconData actionIcon;
  8. final String text;
  9. final GestureTapCallback onTap;
  10. const NotificationWarningWidget({
  11. Key? key,
  12. required this.warningIcon,
  13. required this.actionIcon,
  14. required this.text,
  15. required this.onTap,
  16. }) : super(key: key);
  17. @override
  18. Widget build(BuildContext context) {
  19. return Center(
  20. child: GestureDetector(
  21. onTap: onTap,
  22. child: Padding(
  23. padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 12),
  24. child: Container(
  25. decoration: BoxDecoration(
  26. borderRadius: const BorderRadius.all(
  27. Radius.circular(8),
  28. ),
  29. boxShadow: Theme.of(context).colorScheme.enteTheme.shadowMenu,
  30. color: warning500,
  31. ),
  32. child: Padding(
  33. padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 10),
  34. child: Row(
  35. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  36. children: [
  37. Icon(
  38. warningIcon,
  39. size: 36,
  40. color: Colors.white,
  41. ),
  42. const SizedBox(width: 12),
  43. Flexible(
  44. child: Text(
  45. text,
  46. style: darkTextTheme.bodyBold,
  47. textAlign: TextAlign.left,
  48. ),
  49. ),
  50. const SizedBox(width: 12),
  51. ClipOval(
  52. child: Material(
  53. color: fillFaintDark,
  54. child: InkWell(
  55. splashColor: Colors.red, // Splash color
  56. onTap: onTap,
  57. child: SizedBox(
  58. width: 40,
  59. height: 40,
  60. child: Icon(
  61. actionIcon,
  62. color: Colors.white,
  63. ),
  64. ),
  65. ),
  66. ),
  67. ),
  68. ],
  69. ),
  70. ),
  71. ),
  72. ),
  73. ),
  74. );
  75. }
  76. }