|
@@ -4,34 +4,39 @@ import "package:photos/theme/ente_theme.dart";
|
|
class ChipButtonWidget extends StatelessWidget {
|
|
class ChipButtonWidget extends StatelessWidget {
|
|
final String label;
|
|
final String label;
|
|
final IconData? leadingIcon;
|
|
final IconData? leadingIcon;
|
|
|
|
+ final VoidCallback? onTap;
|
|
const ChipButtonWidget(
|
|
const ChipButtonWidget(
|
|
this.label, {
|
|
this.label, {
|
|
this.leadingIcon,
|
|
this.leadingIcon,
|
|
|
|
+ this.onTap,
|
|
super.key,
|
|
super.key,
|
|
});
|
|
});
|
|
|
|
|
|
@override
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
Widget build(BuildContext context) {
|
|
- return Padding(
|
|
|
|
- padding: const EdgeInsets.all(8.0),
|
|
|
|
- child: Row(
|
|
|
|
- mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
- children: [
|
|
|
|
- leadingIcon != null
|
|
|
|
- ? Icon(
|
|
|
|
- leadingIcon,
|
|
|
|
- size: 17,
|
|
|
|
- )
|
|
|
|
- : const SizedBox.shrink(),
|
|
|
|
- const SizedBox(width: 4),
|
|
|
|
- Padding(
|
|
|
|
- padding: const EdgeInsets.symmetric(horizontal: 4),
|
|
|
|
- child: Text(
|
|
|
|
- label,
|
|
|
|
- style: getEnteTextTheme(context).smallBold,
|
|
|
|
- ),
|
|
|
|
- )
|
|
|
|
- ],
|
|
|
|
|
|
+ return GestureDetector(
|
|
|
|
+ onTap: onTap?.call,
|
|
|
|
+ child: Padding(
|
|
|
|
+ padding: const EdgeInsets.all(8.0),
|
|
|
|
+ child: Row(
|
|
|
|
+ mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
+ children: [
|
|
|
|
+ leadingIcon != null
|
|
|
|
+ ? Icon(
|
|
|
|
+ leadingIcon,
|
|
|
|
+ size: 17,
|
|
|
|
+ )
|
|
|
|
+ : const SizedBox.shrink(),
|
|
|
|
+ const SizedBox(width: 4),
|
|
|
|
+ Padding(
|
|
|
|
+ padding: const EdgeInsets.symmetric(horizontal: 4),
|
|
|
|
+ child: Text(
|
|
|
|
+ label,
|
|
|
|
+ style: getEnteTextTheme(context).smallBold,
|
|
|
|
+ ),
|
|
|
|
+ )
|
|
|
|
+ ],
|
|
|
|
+ ),
|
|
),
|
|
),
|
|
);
|
|
);
|
|
}
|
|
}
|