Skip to content

Commit e64436f

Browse files
committed
added theme songs
1 parent 1b97333 commit e64436f

File tree

4 files changed

+35
-4
lines changed

4 files changed

+35
-4
lines changed

lib/models/anime_detail_provider.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@ class AnimeDetailProvider extends ChangeNotifier {
8080
} catch (e) {
8181
_detail.licensors = ['Unkonwn'];
8282
}
83+
for (var e in resJson['ending_themes']) {
84+
_detail.openingThemes += '\n$e';
85+
}
86+
for (var e in resJson['ending_themes']) {
87+
_detail.endingThemes += '\n$e';
88+
}
8389
notifyListeners();
8490
}
8591

lib/models/anime_details_model.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ class AnimeDetails {
1919
String synopsis;
2020
List<String> licensors;
2121
String studio;
22+
String openingThemes;
23+
String endingThemes;
2224

2325
AnimeDetails({
2426
this.id = 0,
@@ -41,5 +43,7 @@ class AnimeDetails {
4143
this.synopsis = '',
4244
this.licensors = const ['NA'],
4345
this.studio = '',
46+
this.openingThemes = '',
47+
this.endingThemes = '',
4448
});
4549
}

lib/screens/anime_detail_screen.dart

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ class _AnimeDetailScreenState extends State<AnimeDetailScreen> {
5858
),
5959
body: SingleChildScrollView(
6060
child: Column(
61+
crossAxisAlignment: CrossAxisAlignment.start,
6162
children: [
6263
SizedBox(
6364
height: 325,
@@ -195,10 +196,10 @@ class _AnimeDetailScreenState extends State<AnimeDetailScreen> {
195196
padding: const EdgeInsets.all(12.0),
196197
child: ExpandableText(
197198
details.synopsis,
198-
expandText: 'Show more',
199-
collapseText: 'Show less',
199+
expandText: 'Show More',
200+
collapseText: 'Show Less',
200201
maxLines: 4,
201-
linkColor: Colors.blue,
202+
linkColor: Theme.of(context).primaryColor,
202203
),
203204
),
204205
// Padding(
@@ -207,6 +208,26 @@ class _AnimeDetailScreenState extends State<AnimeDetailScreen> {
207208
// ),
208209
const AdditionalInfo(),
209210
const CharacterStaffs(),
211+
Padding(
212+
padding: const EdgeInsets.all(12.0),
213+
child: ExpandableText(
214+
details.openingThemes,
215+
expandText: 'Show More',
216+
collapseText: 'Show Less',
217+
maxLines: 7,
218+
linkColor: Theme.of(context).primaryColor,
219+
),
220+
),
221+
Padding(
222+
padding: const EdgeInsets.only(left: 12.0, right: 12.0),
223+
child: ExpandableText(
224+
details.endingThemes,
225+
expandText: 'Show More',
226+
collapseText: 'Show Less',
227+
maxLines: 7,
228+
linkColor: Theme.of(context).primaryColor,
229+
),
230+
),
210231
],
211232
),
212233
),

lib/widgets/character_staffs.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class _CharacterStaffsState extends State<CharacterStaffs> {
1515
final lst = Provider.of<AnimeDetailProvider>(context).characterStafflist;
1616
return Container(
1717
padding: const EdgeInsets.only(left: 7, top: 12, bottom: 12),
18-
height: 500,
18+
height: 340,
1919
child: ListView.builder(
2020
scrollDirection: Axis.horizontal,
2121
itemCount: lst.length,

0 commit comments

Comments
 (0)