notification_warning_widget.dart 2.3 KB

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