spotube/lib/components/Shared/HeartButton.dart
Kingkor Roy Tirtho 71d6fc5a4a PlaylistView shows image & extra data as header
Loaders & error placeholders added
PlayerOverlay swipe to open PlayerView
fix: Logout functionality broken
2022-06-14 22:14:48 +06:00

30 lines
673 B
Dart

import 'package:flutter/material.dart';
class HeartButton extends StatelessWidget {
final bool isLiked;
final void Function() onPressed;
final IconData? icon;
final Color? color;
const HeartButton({
required this.isLiked,
required this.onPressed,
this.color,
this.icon,
Key? key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return IconButton(
icon: Icon(
icon ??
(!isLiked
? Icons.favorite_outline_rounded
: Icons.favorite_rounded),
color: isLiked ? Theme.of(context).primaryColor : color,
),
onPressed: onPressed,
);
}
}