import 'package:cargocalculaterapp/core/extension/build_context_extension.dart';
import 'package:cargocalculaterapp/core/widgets/shimmer/shimmer_widget.dart';
import 'package:flutter/material.dart';
import '../../../../../core/utils/app_utils.dart';

class OrderListShimmer extends StatelessWidget {
  const OrderListShimmer({super.key});

  @override
  Widget build(BuildContext context) {
    return SliverPadding(
      padding: AppUtils.kPaddingAll16,
      sliver: SliverList.separated(
        itemBuilder: (context, index) {
          return Ink(
            padding: AppUtils.kPaddingAll16,
            width: double.infinity,
            decoration: BoxDecoration(
              borderRadius: AppUtils.kBorderRadius12,
              color: context.color.scaffoldBackgroundColor,
            ),
            child: const Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              mainAxisSize: MainAxisSize.min,
              children: [
                Row(
                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                  children: [
                    ShimmerWidget(width: 60, height: 20),
                    ShimmerWidget(width: 100, height: 20),
                  ],
                ),
                AppUtils.kBoxHeight8,
                Row(
                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                  children: [
                    ShimmerWidget(width: 40, height: 20),
                    ShimmerWidget(width: 70, height: 20),
                  ],
                ),
                AppUtils.kBoxHeight4,
                Row(
                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                  children: [
                    ShimmerWidget(width: 100, height: 20),
                    ShimmerWidget(width: 60, height: 20),
                  ],
                ),
                AppUtils.kBoxHeight4,
                Row(
                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                  children: [
                    ShimmerWidget(width: 80, height: 20),
                    ShimmerWidget(width: 140, height: 20),
                  ],
                ),
              ],
            ),
          );
        },
        separatorBuilder: (_, __) => AppUtils.kBoxHeight12,
        itemCount: 6,
      ),
    );
  }
}
