spotube/lib/components/Shared/HeartButton.dart
Kingkor Roy Tirtho cee3e6744b Version bumped to 2.2.0+10 for next release
Changelogs added
HeartButton icon color fixed
Sponsorhip button added
fix: update checker wrong logic
2022-06-05 11:45:11 +06:00

28 lines
634 B
Dart

import 'package:flutter/material.dart';
class HeartButton extends StatelessWidget {
final bool isLiked;
final void Function() onPressed;
final IconData? icon;
const HeartButton({
required this.isLiked,
required this.onPressed,
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 : null,
),
onPressed: onPressed,
);
}
}