Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[mobile] add destructive variant to fab component

Priyanshu Dangare349884fffc48
diff --git a/mobile/packages/ente_components/lib/components/buttons/fab_component.dart b/mobile/packages/ente_components/lib/components/buttons/fab_component.dart
index 26ecce6141..3663298e29 100644
--- a/mobile/packages/ente_components/lib/components/buttons/fab_component.dart
+++ b/mobile/packages/ente_components/lib/components/buttons/fab_component.dart
@@ -5,7 +5,7 @@ import "package:ente_components/theme/text_styles.dart";
import "package:ente_components/theme/theme.dart";
import "package:flutter/material.dart";
-enum FABComponentVariant { primary, secondary }
+enum FABComponentVariant { primary, secondary, destructive }
/// Figma: https://www.figma.com/design/BuBNPPytxlVnqfmCUW0mgz/Ente-Visual-Design?node-id=21843-6537&m=dev
class FABComponent extends StatefulWidget {
@@ -57,9 +57,12 @@ class _FABComponentState extends State<FABComponent> {
_isPressed ? colors.primaryDark : colors.primary,
FABComponentVariant.secondary =>
_isPressed ? colors.fillDarker : colors.fillDark,
+ FABComponentVariant.destructive =>
+ _isPressed ? colors.warningDark : colors.warning,
};
final foregroundColor = switch (widget.variant) {
- FABComponentVariant.primary => colors.specialWhite,
+ FABComponentVariant.primary ||
+ FABComponentVariant.destructive => colors.specialWhite,
FABComponentVariant.secondary => colors.primary,
};
return GestureDetector(