mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-13 16:05:18 +00:00

Changelogs added HeartButton icon color fixed Sponsorhip button added fix: update checker wrong logic
28 lines
634 B
Dart
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,
|
|
);
|
|
}
|
|
}
|