-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathvideoInfo.dart
94 lines (90 loc) · 3.3 KB
/
videoInfo.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
class VideoFeed extends StatefulWidget {
VideoFeed({Key key}) : super(key: key);
_VideoFeedState createState() => _VideoFeedState();
}
class _VideoFeedState extends State<VideoFeed> {
List<Map> data = [
{
'url': 'https://www.youtube.com/watch?v=3R6KnQLvZNI',
'thumbnail': "https://i.ytimg.com/vi/3R6KnQLvZNI/maxresdefault.jpg",
'title': 'Complete flutter course with 14+ apps',
'date': 'May 15, 2019',
'creator': 'Hitesh Choudhary',
'profile_url':
'https://yt3.ggpht.com/a/AGF-l7-GpYFwHDMQVXkOcO3Ra8bIoZhhiU3oluiJBw=s88-mo-c-c0xffffffff-rj-k-no',
},
{
'url': 'https://www.youtube.com/watch?v=sPW7nDBqt8w',
'thumbnail': 'https://i.ytimg.com/vi/sPW7nDBqt8w/maxresdefault.jpg',
'title': 'The Flutter YouTube Channel is Here!',
'date': 'Feb 22, 2019',
'creator': 'Flutter',
'profile_url':
'https://yt3.ggpht.com/a/AGF-l7-pLWHhqjLR5ZVoKzV9_eU6IjYrDyhvSLRjsw=s88-mo-c-c0xffffffff-rj-k-no',
},
{
'url': 'https://www.youtube.com/watch?v=vqPG1tU6-c0',
'thumbnail': 'https://i.ytimg.com/vi/vqPG1tU6-c0/maxresdefault.jpg',
'title': 'Introducing The Boring Show!',
'date': 'Feb 22, 2019',
'creator': 'Flutter',
'profile_url':
'https://yt3.ggpht.com/a/AGF-l7-pLWHhqjLR5ZVoKzV9_eU6IjYrDyhvSLRjsw=s88-mo-c-c0xffffffff-rj-k-no',
},
{
'url': 'https://www.youtube.com/watch?v=frEG8f0Aa1c',
'thumbnail': 'https://i.ytimg.com/vi/frEG8f0Aa1c/maxresdefault.jpg',
'title': 'Flutter vs React native',
'date': 'Apr 10, 2019',
'creator': 'Hitesh Choudhary',
'profile_url':
'https://yt3.ggpht.com/a/AGF-l7-GpYFwHDMQVXkOcO3Ra8bIoZhhiU3oluiJBw=s88-mo-c-c0xffffffff-rj-k-no',
},
{
'url': 'https://youtu.be/GE0oeBj9Cr0',
'thumbnail': 'https://i.ytimg.com/vi/GE0oeBj9Cr0/maxresdefault.jpg',
'title': 'How to create first flutter for web project step by step',
'date': 'May 11, 2019',
'creator': 'Hitesh Choudhary',
'profile_url':
'https://yt3.ggpht.com/a/AGF-l7-GpYFwHDMQVXkOcO3Ra8bIoZhhiU3oluiJBw=s88-mo-c-c0xffffffff-rj-k-no',
},
];
@override
Widget build(BuildContext context) {
return ListView.builder(
itemCount: data.length,
itemBuilder: (BuildContext context, int index) {
return Container(
child: Column(
children: <Widget>[
AspectRatio(
child: Image(
image: NetworkImage(data[index]['thumbnail']),
centerSlice: Rect.largest,
),
aspectRatio: 16 / 9,
),
ListTile(
leading: CircleAvatar(
backgroundImage: NetworkImage(data[index]['profile_url']),
),
title: Text(
data[index]['title'],
style: TextStyle(fontWeight: FontWeight.bold),
),
subtitle: Text(data[index]['creator']+" . "+data[index]['date'],
style: TextStyle(
color: Colors.grey,
)),
trailing: Icon(Icons.more_vert),
),
],
),
);
},
);
}
}