forked from eatvio/eatvio_app
45 lines
1.1 KiB
Dart
45 lines
1.1 KiB
Dart
import 'package:eatvio_app/core/theme/theme_helper.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
|
class BookmarkButton extends StatelessWidget {
|
|
const BookmarkButton({
|
|
super.key,
|
|
required this.onTap,
|
|
required this.color,
|
|
required this.isFavorite,
|
|
required this.width,
|
|
required this.height,
|
|
required this.size,
|
|
this.shape,
|
|
this.borderRadius,
|
|
});
|
|
final void Function() onTap;
|
|
final Color color;
|
|
final BoxShape? shape;
|
|
final bool isFavorite;
|
|
final BorderRadiusGeometry? borderRadius;
|
|
final double width;
|
|
final double height;
|
|
final double size;
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return GestureDetector(
|
|
onTap: onTap,
|
|
child: Container(
|
|
width: width,
|
|
height: height,
|
|
decoration: BoxDecoration(
|
|
color: color,
|
|
shape: shape ?? BoxShape.rectangle,
|
|
borderRadius: borderRadius,
|
|
),
|
|
child: Icon(
|
|
isFavorite ? Icons.bookmark : Icons.bookmark_border_rounded,
|
|
color: appTheme.black,
|
|
size: size,
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|