mirror of
https://gitlab.com/moepoi/neonime-app.git
synced 2025-01-03 09:49:08 +01:00
Fix episode list scroll on anime detail
This commit is contained in:
parent
430345f9b7
commit
edcb747a1b
1 changed files with 62 additions and 64 deletions
|
@ -30,9 +30,7 @@ class AnimeDetail extends StatelessWidget {
|
|||
return Text(error.toString());
|
||||
},
|
||||
renderSuccess: ({data}) {
|
||||
return Center(
|
||||
child: ListView(
|
||||
children: [
|
||||
var allWidgets = [
|
||||
Row(
|
||||
children: [
|
||||
Flexible(
|
||||
|
@ -43,17 +41,17 @@ class AnimeDetail extends StatelessWidget {
|
|||
borderRadius: BorderRadius.circular(8.0),
|
||||
child: CachedNetworkImage(
|
||||
imageUrl: data['image'],
|
||||
placeholder: (context, url) => CupertinoActivityIndicator(),
|
||||
errorWidget: (context, url, error) => Image.asset('lib/assets/image-error.jpg'),
|
||||
placeholder: (context, url) =>
|
||||
CupertinoActivityIndicator(),
|
||||
errorWidget: (context, url, error) =>
|
||||
Image.asset('lib/assets/image-error.jpg'),
|
||||
fadeOutDuration: Duration(milliseconds: 5),
|
||||
imageBuilder: (context, imageProvider) => Container(
|
||||
width: 120,
|
||||
height: 160,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: imageProvider,
|
||||
fit: BoxFit.cover
|
||||
),
|
||||
image: imageProvider, fit: BoxFit.cover),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -78,31 +76,31 @@ class AnimeDetail extends StatelessWidget {
|
|||
child: Text(data['description']),
|
||||
),
|
||||
),
|
||||
];
|
||||
final totalEps = data['episode_title'].length;
|
||||
for (var x=0; x < totalEps; x++) {
|
||||
allWidgets.add(
|
||||
Container(
|
||||
height: 542,
|
||||
padding: EdgeInsets.all(8),
|
||||
child: ListView.builder(
|
||||
itemCount: data['episode_title'].length,
|
||||
itemBuilder: (context, index) {
|
||||
return Container(
|
||||
padding: EdgeInsets.all(8),
|
||||
child: CupertinoButton.filled(
|
||||
child: Text(data['episode_title'][index]),
|
||||
child: Text(data['episode_title'][x]),
|
||||
onPressed: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => EpisodeDetail(),
|
||||
settings: RouteSettings(arguments: {
|
||||
'title': data['episode_title'][index],
|
||||
'url': data['episode_url'][index]
|
||||
'title': data['episode_title'][x],
|
||||
'url': data['episode_url'][x]
|
||||
})));
|
||||
},
|
||||
),
|
||||
)
|
||||
)
|
||||
);
|
||||
}),
|
||||
),
|
||||
],
|
||||
}
|
||||
return Center(
|
||||
child: ListView(
|
||||
children: allWidgets
|
||||
));
|
||||
}),
|
||||
),
|
||||
|
|
Loading…
Reference in a new issue