import 'package:flutter/material.dart';

import '../../../models/gas_refill/gas_refill_details.dart';
import '../../app_style/colors.dart';

class GasRefillCreateDetailsItem extends StatelessWidget {
  final GasRefillDetails model;
  final VoidCallback? onDelete;

  const GasRefillCreateDetailsItem({Key? key, required this.model, this.onDelete}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Column(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: [
        Row(
          children: [Expanded(child: Text(model.type?.label ?? "")), IconButton(onPressed: onDelete, color: AColors.red, icon: const Icon(Icons.delete))],
        ),
        Row(
          children: [
            Text(model.requestedQuantity?.toStringAsFixed(0) ?? ""),
          ],
        ),
        if (model.deliveredQuantity != null)
          Row(
            children: [
              const Text("Delivered Quantity"),
              Text(model.deliveredQuantity?.toStringAsFixed(0) ?? ""),
            ],
          ),
        const Divider(),
      ],
    );
  }
}
