Skip to content

Commit dba04e5

Browse files
committed
Create list my favorite movies
1 parent 2e879e4 commit dba04e5

6 files changed

+63
-2
lines changed
88.8 KB
Loading
79.7 KB
Loading
66.9 KB
Loading
80.6 KB
Loading
79.2 KB
Loading

lib/src/ui/home/home_screen.dart

Lines changed: 63 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,12 @@ class HomeScreen extends StatelessWidget {
1616
child: Column(
1717
children: <Widget>[
1818
_buildWidgetAppBar(),
19-
SizedBox(height: 20.0),
19+
SizedBox(height: 24.0),
2020
_buildWidgetBanner(mediaQuery),
21-
SizedBox(height: 20.0),
21+
SizedBox(height: 24.0),
2222
_buildWidgetCategories(mediaQuery),
23+
SizedBox(height: 24.0),
24+
_buildWidgetMyList(mediaQuery, context),
2325
],
2426
),
2527
),
@@ -206,4 +208,63 @@ class HomeScreen extends StatelessWidget {
206208
),
207209
);
208210
}
211+
212+
Widget _buildWidgetMyList(MediaQueryData mediaQuery, BuildContext context) {
213+
var listPosterMyList = [
214+
'assets/images/movie_1_my_list_backdrop_path.jpeg',
215+
'assets/images/movie_2_my_list_backdrop_path.jpeg',
216+
'assets/images/movie_3_my_list_backdrop_path.jpeg',
217+
'assets/images/movie_4_my_list_backdrop_path.jpeg',
218+
'assets/images/movie_5_my_list_backdrop_path.jpeg',
219+
];
220+
return Container(
221+
width: mediaQuery.size.width,
222+
child: Column(
223+
children: <Widget>[
224+
Padding(
225+
padding: const EdgeInsets.symmetric(horizontal: 16.0),
226+
child: Row(
227+
crossAxisAlignment: CrossAxisAlignment.center,
228+
children: <Widget>[
229+
Expanded(
230+
child: Text(
231+
'My list',
232+
style: Theme.of(context).textTheme.subhead.merge(
233+
TextStyle(
234+
color: Colors.black,
235+
),
236+
),
237+
),
238+
),
239+
Icon(Icons.chevron_right),
240+
],
241+
),
242+
),
243+
SizedBox(height: 8.0),
244+
Container(
245+
height: 200.0,
246+
child: ListView.builder(
247+
scrollDirection: Axis.horizontal,
248+
itemBuilder: (BuildContext context, int index) {
249+
return Padding(
250+
padding: EdgeInsets.only(
251+
left: 16.0,
252+
right: index == listPosterMyList.length - 1 ? 16.0 : 0.0,
253+
),
254+
child: ClipRRect(
255+
borderRadius: BorderRadius.circular(8.0),
256+
child: Image.asset(
257+
listPosterMyList[index],
258+
fit: BoxFit.cover,
259+
),
260+
),
261+
);
262+
},
263+
itemCount: listPosterMyList.length,
264+
),
265+
),
266+
],
267+
),
268+
);
269+
}
209270
}

0 commit comments

Comments
 (0)