icon_button_widget.dart 890 B

1234567891011121314151617181920212223242526272829303132333435
  1. import 'package:flutter/material.dart';
  2. import 'package:photos/theme/ente_theme.dart';
  3. class IconButtonWidget extends StatelessWidget {
  4. final bool isPrimary;
  5. final bool isSecondary;
  6. final bool isRounded;
  7. final IconData icon;
  8. const IconButtonWidget({
  9. this.isPrimary = true,
  10. this.isSecondary = false,
  11. this.isRounded = false,
  12. required this.icon,
  13. super.key,
  14. });
  15. @override
  16. Widget build(BuildContext context) {
  17. final colorTheme = getEnteColorScheme(context);
  18. return GestureDetector(
  19. child: Container(
  20. padding: const EdgeInsets.all(8),
  21. height: 40,
  22. width: 40,
  23. decoration: BoxDecoration(
  24. borderRadius: BorderRadius.circular(20),
  25. ),
  26. child: Icon(
  27. Icons.close_outlined,
  28. color: isSecondary ? colorTheme.strokeMuted : colorTheme.strokeBase,
  29. ),
  30. ),
  31. );
  32. }
  33. }