Advertisement
rahmrny

horizontal product cart

Feb 15th, 2022
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 3.30 KB | None | 0 0
  1. @override
  2.   Widget build(BuildContext context) {
  3.     return Container(
  4.       height: 400,
  5.       margin: const EdgeInsets.only(left: 30, bottom: 5),
  6.       decoration: BoxDecoration(
  7.         color: Colors.white,
  8.         boxShadow: [
  9.           BoxShadow(
  10.               offset: const Offset(1, 3),
  11.               blurRadius: 3,
  12.               color: (Colors.grey[300])!),
  13.         ],
  14.         borderRadius: BorderRadius.circular(10),
  15.       ),
  16.       child: Row(
  17.         children: [
  18.           Container(
  19.             width: 100,
  20.             height: double.maxFinite,
  21.             decoration: BoxDecoration(
  22.               borderRadius: BorderRadius.circular(10),
  23.               boxShadow: [
  24.                 BoxShadow(
  25.                   color: (Colors.grey[400])!,
  26.                   offset: const Offset(2, 1),
  27.                   blurRadius: 3,
  28.                 )
  29.               ],
  30.             ),
  31.             child: ClipRRect(
  32.               borderRadius: BorderRadius.circular(10),
  33.               child: Image(
  34.                 image: NetworkImage("http://belankon.com/$productImage"),
  35.                 fit: BoxFit.cover,
  36.               ),
  37.             ),
  38.           ),
  39.           const SizedBox(width: 10),
  40.           Column(
  41.             crossAxisAlignment: CrossAxisAlignment.start,
  42.             children: [
  43.               const SizedBox(height: 10),
  44.               Text(
  45.                 productName[0].toUpperCase() + productName.substring(1),
  46.                 style: const TextStyle(
  47.                   fontSize: 16,
  48.                   fontFamily: "Montserrat",
  49.                   fontWeight: FontWeight.w600,
  50.                   decoration: TextDecoration.underline,
  51.                 ),
  52.               ),
  53.               Text(
  54.                 streetAddress,
  55.                 style: const TextStyle(
  56.                   fontFamily: "Montserrat",
  57.                   fontWeight: FontWeight.w200,
  58.                 ),
  59.                 overflow: TextOverflow.clip,
  60.                 maxLines: 1,
  61.               ),
  62.               const SizedBox(height: 10),
  63.               Text(
  64.                 'Rp. ' + price.toString(),
  65.                 style: const TextStyle(
  66.                   fontFamily: "Montserrat",
  67.                   fontWeight: FontWeight.w200,
  68.                 ),
  69.               ),
  70.               const SizedBox(height: 5),
  71.               buildRating(),
  72.             ],
  73.           )
  74.         ],
  75.       ),
  76.     );
  77.   }
  78.  
  79.   Row buildRating() {
  80.     return Row(
  81.       children: [
  82.         SvgPicture.asset(
  83.           "assets/belankon-icons/star.svg",
  84.           width: 14,
  85.         ),
  86.         SvgPicture.asset(
  87.           "assets/belankon-icons/star.svg",
  88.           width: 14,
  89.         ),
  90.         SvgPicture.asset(
  91.           "assets/belankon-icons/star.svg",
  92.           width: 14,
  93.         ),
  94.         SvgPicture.asset(
  95.           "assets/belankon-icons/star.svg",
  96.           width: 14,
  97.         ),
  98.         SvgPicture.asset(
  99.           "assets/belankon-icons/star_border.svg",
  100.           width: 14,
  101.         ),
  102.         const SizedBox(width: 10),
  103.         const Text(
  104.           "1230",
  105.           style: TextStyle(fontFamily: "Montserrat"),
  106.         ),
  107.         const SizedBox(width: 5),
  108.         SvgPicture.asset(
  109.           "assets/belankon-icons/account.svg",
  110.           width: 14,
  111.         ),
  112.         const SizedBox(height: 5),
  113.       ],
  114.     );
  115.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement