11import 'package:flutter/material.dart' ;
22import 'package:flutter_bloc/flutter_bloc.dart' ;
3- import '../cubit/home_cubit .dart' ;
4- import '../ cubit/home_state .dart' ;
5- import '../api/models/movie_responses .dart' ;
6- import 'details_page.dart' ;
3+ import 'package:tmdb_flutter/app/api/models/movie_responses .dart' ;
4+ import 'package:tmdb_flutter/app/ cubit/home_cubit .dart' ;
5+ import 'package:tmdb_flutter/app/cubit/home_state .dart' ;
6+ import 'package:tmdb_flutter/app/view/ details_page.dart' ;
77
88class HomePage extends StatelessWidget {
99 const HomePage ({super .key});
@@ -50,7 +50,7 @@ class HomePage extends StatelessWidget {
5050 onRefresh: () => context.read <HomeCubit >().refreshHomeData (),
5151 child: SingleChildScrollView (
5252 child: Padding (
53- padding: const EdgeInsets .symmetric (horizontal: 16.0 ),
53+ padding: const EdgeInsets .symmetric (horizontal: 16 ),
5454 child: Column (
5555 crossAxisAlignment: CrossAxisAlignment .start,
5656 children: [
@@ -76,14 +76,16 @@ class HomePage extends StatelessWidget {
7676 decoration: InputDecoration (
7777 hintText: 'Search' ,
7878 hintStyle: const TextStyle (color: Colors .black54),
79- prefixIcon: const Icon (Icons .search, color: Colors .black54),
79+ prefixIcon:
80+ const Icon (Icons .search, color: Colors .black54),
8081 filled: true ,
8182 fillColor: const Color (0xFFE7E2EC ),
8283 border: OutlineInputBorder (
8384 borderRadius: BorderRadius .circular (30 ),
8485 borderSide: BorderSide .none,
8586 ),
86- contentPadding: const EdgeInsets .symmetric (vertical: 0 ),
87+ contentPadding:
88+ EdgeInsets .zero,
8789 ),
8890 style: const TextStyle (color: Colors .black),
8991 ),
@@ -190,9 +192,10 @@ class HomePage extends StatelessWidget {
190192}
191193
192194class _CategoryChip extends StatelessWidget {
195+ const _CategoryChip ({required this .label, this .selected = false });
196+
193197 final String label;
194198 final bool selected;
195- const _CategoryChip ({required this .label, this .selected = false });
196199
197200 @override
198201 Widget build (BuildContext context) {
@@ -217,22 +220,23 @@ class _CategoryChip extends StatelessWidget {
217220}
218221
219222class _MovieCard extends StatelessWidget {
220- final Movie movie;
221- final bool small;
222- final Color ? borderColor;
223223 const _MovieCard ({
224224 required this .movie,
225225 this .small = false ,
226226 this .borderColor,
227227 });
228228
229+ final Movie movie;
230+ final bool small;
231+ final Color ? borderColor;
232+
229233 @override
230234 Widget build (BuildContext context) {
231235 return GestureDetector (
232236 onTap: () {
233237 Navigator .push (
234238 context,
235- MaterialPageRoute (
239+ MaterialPageRoute < void > (
236240 builder: (context) => DetailsPage (movie: movie),
237241 ),
238242 );
@@ -257,7 +261,8 @@ class _MovieCard extends StatelessWidget {
257261 crossAxisAlignment: CrossAxisAlignment .start,
258262 children: [
259263 ClipRRect (
260- borderRadius: const BorderRadius .vertical (top: Radius .circular (22 )),
264+ borderRadius:
265+ const BorderRadius .vertical (top: Radius .circular (22 )),
261266 child: Image .network (
262267 'https://image.tmdb.org/t/p/w500${movie .posterPath }' ,
263268 height: small ? 180 : 320 ,
@@ -312,4 +317,4 @@ class _MovieCard extends StatelessWidget {
312317 ),
313318 );
314319 }
315- }
320+ }
0 commit comments