forked from eatvio/eatvio_app
fixed layout of diets feed and added text styles
This commit is contained in:
44
lib/core/widgets/bookmark_button.dart
Normal file
44
lib/core/widgets/bookmark_button.dart
Normal file
@@ -0,0 +1,44 @@
|
||||
import 'package:eatvio_app/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,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user