Skip to content

Commit

Permalink
94: Add total episodes as a badge
Browse files Browse the repository at this point in the history
  • Loading branch information
JICA98 committed Sep 1, 2024
1 parent f207388 commit 1a74bfb
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 16 deletions.
4 changes: 2 additions & 2 deletions lib/user/list_pref.dart
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,8 @@ CustomizableField _totalEpsField() {
title: 'Total Episodes',
description: 'Total number of episodes',
position: Position(
top: 70,
right: 15,
top: 5,
left: 35,
),
);
}
Expand Down
32 changes: 18 additions & 14 deletions lib/widgets/user/customizedlist.dart
Original file line number Diff line number Diff line change
Expand Up @@ -698,18 +698,23 @@ class _CustomizableFieldWidgetState extends State<CustomizableFieldWidget> {
return _episodePill(epsDifference, Colors.red[700]);
}

Container _episodePill(int epsDifference, Color? color) {
Widget _episodePill(int epsDifference, Color? color) {
return Container(
padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 3),
height: 17.0,
width: 30.0,
padding: const EdgeInsets.symmetric(horizontal: 3, vertical: 1),
decoration: BoxDecoration(
color: color,
borderRadius: BorderRadius.circular(4),
borderRadius: BorderRadius.circular(2),
),
child: Text(
'${NumberFormat.compact().format(epsDifference)}',
style: TextStyle(
fontSize: 10,
color: Colors.white,
child: Center(
child: AutoSizeText(
'${NumberFormat.compact().format(epsDifference)}',
minFontSize: 7,
maxFontSize: 10,
style: TextStyle(
color: Colors.white,
),
),
),
);
Expand Down Expand Up @@ -841,11 +846,9 @@ class _CustomizableFieldWidgetState extends State<CustomizableFieldWidget> {
episodes = episode - 1;
}
}
return title(
'${episodes} Eps',
fontSize: 12,
opacity: 1,
);
if (episodes == null) return SB.z;

return _episodePill(episodes, Colors.grey[500]);
}

Widget _genreWidget() {
Expand Down Expand Up @@ -891,7 +894,8 @@ class _CustomizableFieldWidgetState extends State<CustomizableFieldWidget> {
if (data?.timestamp == null) {
return SB.z;
}
return CountDownWidget.expandedCountdownWidget(data!, context: context, padding: EdgeInsets.zero);
return CountDownWidget.expandedCountdownWidget(data!,
context: context, padding: EdgeInsets.zero);
}

Widget _airingDateWidget() {
Expand Down

0 comments on commit 1a74bfb

Please sign in to comment.