Skip to content

armgit / ente

Public Imported from GitHub
0

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

add new components

AmanRajSinghMouryae831e2ebb4f3
diff --git a/mobile/apps/photos/lib/ui/components/buttons/filter_pill_widget.dart b/mobile/apps/photos/lib/ui/components/buttons/filter_pill_widget.dart
new file mode 100644
index 0000000000..2747096945
--- /dev/null
+++ b/mobile/apps/photos/lib/ui/components/buttons/filter_pill_widget.dart
@@ -0,0 +1,40 @@
+import "package:flutter/material.dart";
+import "package:photos/theme/ente_theme.dart";
+
+class FilterPillWidget extends StatelessWidget {
+ final String label;
+ final bool selected;
+ final VoidCallback onTap;
+
+ const FilterPillWidget({
+ super.key,
+ required this.label,
+ required this.selected,
+ required this.onTap,
+ });
+
+ @override
+ Widget build(BuildContext context) {
+ final colorScheme = getEnteColorScheme(context);
+ final textTheme = getEnteTextTheme(context);
+ return GestureDetector(
+ behavior: HitTestBehavior.opaque,
+ onTap: onTap,
+ child: AnimatedContainer(
+ duration: const Duration(milliseconds: 150),
+ curve: Curves.easeOut,
+ padding: const EdgeInsets.symmetric(horizontal: 18, vertical: 12),
+ decoration: BoxDecoration(
+ color: selected ? colorScheme.greenBase : colorScheme.fill,
+ borderRadius: BorderRadius.circular(16),
+ ),
+ child: Text(
+ label,
+ style: selected
+ ? textTheme.mini.copyWith(color: Colors.white)
+ : textTheme.miniMuted,
+ ),
+ ),
+ );
+ }
+}
diff --git a/mobile/apps/photos/lib/ui/components/buttons/soft_icon_button.dart b/mobile/apps/photos/lib/ui/components/buttons/soft_icon_button.dart
new file mode 100644
index 0000000000..e720f3176f
--- /dev/null
+++ b/mobile/apps/photos/lib/ui/components/buttons/soft_icon_button.dart
@@ -0,0 +1,33 @@
+import "package:flutter/material.dart";
+import "package:photos/theme/ente_theme.dart";
+
+class SoftIconButton extends StatelessWidget {
+ final Widget icon;
+ final VoidCallback onTap;
+ final GestureTapDownCallback? onTapDown;
+
+ const SoftIconButton({
+ super.key,
+ required this.icon,
+ required this.onTap,
+ this.onTapDown,
+ });
+
+ @override
+ Widget build(BuildContext context) {
+ final colorScheme = getEnteColorScheme(context);
+ return GestureDetector(
+ behavior: HitTestBehavior.opaque,
+ onTapDown: onTapDown,
+ onTap: onTap,
+ child: Container(
+ padding: const EdgeInsets.all(10),
+ decoration: BoxDecoration(
+ color: colorScheme.fill,
+ borderRadius: BorderRadius.circular(12),
+ ),
+ child: icon,
+ ),
+ );
+ }
+}