Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Feat/change arrows and fav colors #216

Merged
merged 2 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions lib/features/parkings_view/widgets/parking_favourite.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,32 @@ class FavouriteParkingWidget extends ConsumerWidget {
visualDensity: VisualDensity.compact,
onPressed: favController.toggle,
icon: isFavorite == null
? const FavouriteIcon(
? FavouriteIcon(
icon: Icons.error,
color: context.colorTheme.whiteSoap,
)
: FavouriteIcon(
icon: isFavorite
? Icons.favorite_rounded
: Icons.favorite_border_outlined,
color: isFavorite
? context.colorTheme.orangePomegranade
: context.colorTheme.whiteSoap,
),
);
}
}

class FavouriteIcon extends StatelessWidget {
const FavouriteIcon({super.key, required this.icon});
const FavouriteIcon({super.key, required this.icon, required this.color});
final IconData icon;
final Color color;

@override
Widget build(BuildContext context) {
return Icon(
icon,
color: context.colorTheme.whiteSoap,
color: color,
size: 22,
shadows: iparkingShadows,
);
Expand Down
15 changes: 14 additions & 1 deletion lib/features/parkings_view/widgets/parking_wide_tile_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@ class _RightColumn extends StatelessWidget {
),
Icon(
parking.trend.arrowIcon,
color: context.colorTheme.whiteSoap,
color: isActive
? arrowColor(parking.trend, context)
: context.colorTheme.whiteSoap,
size: 21,
),
],
Expand All @@ -156,3 +158,14 @@ class _RightColumn extends StatelessWidget {
);
}
}

Color arrowColor(String trend, BuildContext context) {
switch (trend) {
case "1":
return const Color(0xFF28a745); //green arrow
case "-1":
return const Color(0xFFdc3545); //red arrow
default:
return context.colorTheme.whiteSoap;
}
}