@@ -254,29 +254,46 @@ class _HomeViewState extends State<HomeView> {
254
254
},
255
255
);
256
256
}
257
- return Column (
258
- mainAxisAlignment: MainAxisAlignment .center,
259
- children: [
260
- if (state.failure is ServerFailure )
261
- Image .asset (
262
- 'assets/status_image/internal-server-error.png' ),
263
- if (state.failure is CacheFailure )
264
- Image .asset ('assets/status_image/no-connection.png' ),
265
- const Text ("Products not found!" ),
266
- IconButton (
267
- onPressed: () {
268
- context.read <ProductBloc >().add (GetProducts (
269
- FilterProductParams (
270
- keyword: context
271
- .read <FilterCubit >()
272
- .searchController
273
- .text)));
274
- },
275
- icon: const Icon (Icons .refresh)),
276
- SizedBox (
277
- height: MediaQuery .of (context).size.height * 0.1 ,
278
- )
279
- ],
257
+ return Center (
258
+ child: Column (
259
+ mainAxisAlignment: MainAxisAlignment .center,
260
+ crossAxisAlignment: CrossAxisAlignment .center,
261
+ children: [
262
+ if (state.failure is ServerFailure )
263
+ Image .asset (
264
+ 'assets/status_image/internal-server-error.png' ,
265
+ width: MediaQuery .of (context).size.width * 0.7 ,
266
+ ),
267
+ if (state.failure is CacheFailure )
268
+ Image .asset (
269
+ 'assets/status_image/no-connection.png' ,
270
+ width: MediaQuery .of (context).size.width * 0.7 ,
271
+ ),
272
+ // if (state.products.isEmpty)
273
+ // Image.asset(
274
+ // 'assets/status_image/cloths-choosing.png',
275
+ // width: MediaQuery.of(context).size.width * 0.7,
276
+ // ),
277
+ Text (
278
+ "Products not found!" ,
279
+ style: TextStyle (color: Colors .grey.shade600),
280
+ ),
281
+ IconButton (
282
+ color: Colors .grey.shade600,
283
+ onPressed: () {
284
+ context.read <ProductBloc >().add (GetProducts (
285
+ FilterProductParams (
286
+ keyword: context
287
+ .read <FilterCubit >()
288
+ .searchController
289
+ .text)));
290
+ },
291
+ icon: const Icon (Icons .refresh)),
292
+ SizedBox (
293
+ height: MediaQuery .of (context).size.height * 0.1 ,
294
+ )
295
+ ],
296
+ ),
280
297
);
281
298
}
282
299
return RefreshIndicator (
0 commit comments