notification_warning_widget.dart 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. import 'package:photos/ui/components/icon_button_widget.dart';
  6. class NotificationWarningWidget extends StatelessWidget {
  7. final IconData warningIcon;
  8. final IconData actionIcon;
  9. final String text;
  10. final GestureTapCallback onTap;
  11. const NotificationWarningWidget({
  12. Key? key,
  13. required this.warningIcon,
  14. required this.actionIcon,
  15. required this.text,
  16. required this.onTap,
  17. }) : super(key: key);
  18. @override
  19. Widget build(BuildContext context) {
  20. return Center(
  21. child: GestureDetector(
  22. onTap: onTap,
  23. child: Padding(
  24. padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 12),
  25. child: Container(
  26. decoration: BoxDecoration(
  27. borderRadius: const BorderRadius.all(
  28. Radius.circular(8),
  29. ),
  30. boxShadow: Theme.of(context).colorScheme.enteTheme.shadowMenu,
  31. color: warning500,
  32. ),
  33. child: Padding(
  34. padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
  35. child: Row(
  36. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  37. children: [
  38. Icon(
  39. warningIcon,
  40. size: 36,
  41. color: Colors.white,
  42. ),
  43. const SizedBox(width: 12),
  44. Flexible(
  45. child: Text(
  46. text,
  47. style: darkTextTheme.bodyBold,
  48. textAlign: TextAlign.left,
  49. ),
  50. ),
  51. const SizedBox(width: 12),
  52. IconButtonWidget(
  53. icon: actionIcon,
  54. iconButtonType: IconButtonType.rounded,
  55. iconColor: strokeBaseDark,
  56. defaultColor: fillFaintDark,
  57. pressedColor: fillMutedDark,
  58. onTap: onTap,
  59. )
  60. ],
  61. ),
  62. ),
  63. ),
  64. ),
  65. ),
  66. );
  67. }
  68. }