You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
66 lines
1.8 KiB
66 lines
1.8 KiB
import 'package:flutter/material.dart';
|
|
import 'package:flutter/rendering.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
import 'package:teso/Classes/API%20Clasess/Post.dart';
|
|
import 'package:teso/Pages/Sub_Pages/Posts/ViewPost.dart';
|
|
import 'package:teso/providers/user_provider.dart';
|
|
|
|
class VideoList extends StatefulWidget {
|
|
final List<Post> postedAd;
|
|
|
|
VideoList({Key key, this.postedAd}) : super(key: key);
|
|
|
|
@override
|
|
_VideoListState createState() => _VideoListState();
|
|
}
|
|
|
|
class _VideoListState extends State<VideoList> {
|
|
@override
|
|
void initState() {
|
|
Provider.of<UserProvider>(context, listen: false)
|
|
.predownloadAds(widget.postedAd.map((e) => e.playbackID).toList());
|
|
super.initState();
|
|
}
|
|
|
|
report(Post post) {
|
|
Navigator.pop(context, post);
|
|
Navigator.pop(context, post);
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
appBar: AppBar(
|
|
automaticallyImplyLeading: true,
|
|
backgroundColor: Colors.transparent,
|
|
leading: InkWell(
|
|
onTap: () => Navigator.pop(context),
|
|
child: Container(
|
|
height: 50,
|
|
width: 40,
|
|
margin: EdgeInsets.symmetric(
|
|
vertical: 30.0,
|
|
horizontal: 10,
|
|
),
|
|
child: Icon(
|
|
Icons.arrow_back_ios,
|
|
color: Colors.white,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
extendBodyBehindAppBar: true,
|
|
body: PageView(
|
|
scrollDirection: Axis.vertical,
|
|
children: List<ViewPost>.generate(
|
|
widget.postedAd.length > 10 ? 10 : widget.postedAd.length,
|
|
(index) => new ViewPost(
|
|
play: true,
|
|
postedAd: widget.postedAd[index],
|
|
report: report,
|
|
)),
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|