import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';

import '../../../app.dart';

class OrderItemCard extends StatelessWidget {
  final OrderItem item;

  OrderItemCard({required this.item});

  @override
  Widget build(BuildContext context) {
    return Container(
      // height: 0.20.sh,
      margin: EdgeInsets.only(bottom: 20.h),
      child: Row(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          // Image
          // Padding(
          //   padding: EdgeInsets.only(right: 12.w),
          //   child: Container(
          //     decoration: BoxDecoration(
          //       border: Border.all(color: Colors.grey.withOpacity(0.50)),
          //       borderRadius: BorderRadius.circular(16),
          //     ),
          //     child: cachedImageNetwork(
          //       getImagePath(item.product.images),
          //       BoxFit.cover,
          //       BorderRadius.circular(16),
          //       0.22.sw,
          //       0.14.sh,
          //     ),
          //   ),
          // ),

          Flexible(
            child: Container(
              padding: EdgeInsets.only(right: 4.w),
              child: Column(
                crossAxisAlignment: CrossAxisAlignment.start,
                children: [
                  // RichText(
                  //   overflow: TextOverflow.ellipsis,
                  //   maxLines: 2,
                  //   text: TextSpan(
                  //     text: '', // TODO: add brand name
                  //     style: new TextStyle(fontWeight: FontWeight.w500, fontSize: 13.sp, color: ThemeColor.black),
                  //     children: <TextSpan>[
                  //       TextSpan(
                  //         text: item.product.name,
                  //         style: TextStyle(fontWeight: FontWeight.normal, fontSize: 13.sp),
                  //       ),
                  //     ],
                  //   ),
                  // ),
                  SizedBox(height: 12.h),
                  // print attributes
                  // SuperAttributeWidget(superAttributes: item.product.superAttributes),
                  // SizedBox(height: 8.h),
                  ItemCardRowBuilder(title: 'price'.tr, content: item.formattedPrice),
                  SizedBox(height: 8.h),
                  ItemCardRowBuilder(title: 'quantity'.tr, content: item.qtyOrdered.toString()),
                ],
              ),
            ),
          ),
        ],
      ),
    );
  }
}
