@@ -24,10 +24,7 @@ class ProductDetailScreen extends StatelessWidget {
2424 controller.productImageDefaultIndex.value = 0 ;
2525 Navigator .pop (context);
2626 },
27- icon: const Icon (
28- Icons .arrow_back,
29- color: Colors .black,
30- ),
27+ icon: const Icon (Icons .arrow_back, color: Colors .black),
3128 ),
3229 );
3330 }
@@ -54,10 +51,7 @@ class ProductDetailScreen extends StatelessWidget {
5451 itemBuilder: (_, index) {
5552 return FittedBox (
5653 fit: BoxFit .none,
57- child: Image .asset (
58- product.images[index],
59- scale: 3 ,
60- ),
54+ child: Image .asset (product.images[index], scale: 3 ),
6155 );
6256 },
6357 ),
@@ -83,9 +77,7 @@ class ProductDetailScreen extends StatelessWidget {
8377 RatingBar .builder (
8478 initialRating: product.rating,
8579 direction: Axis .horizontal,
86- itemBuilder: (_, index) {
87- return const Icon (Icons .star, color: Colors .amber);
88- },
80+ itemBuilder: (_, __) => const Icon (Icons .star, color: Colors .amber),
8981 onRatingUpdate: (_) {},
9082 ),
9183 Text (
@@ -196,19 +188,17 @@ class ProductDetailScreen extends StatelessWidget {
196188 SizedBox (
197189 height: 40 ,
198190 child: GetBuilder <ProductController >(
199- builder: (ProductController controller) {
200- return productSizesListView ();
201- },
191+ builder: (_) => productSizesListView (),
202192 ),
203193 ),
204194 const SizedBox (height: 20 ),
205195 SizedBox (
206196 width: double .infinity,
207197 child: ElevatedButton (
208- child: const Text ("Add to cart" ),
209198 onPressed: product.isAvailable
210199 ? () => controller.addToCart (product)
211200 : null ,
201+ child: const Text ("Add to cart" ),
212202 ),
213203 )
214204 ],
0 commit comments