import 'package:diplomaticquarterapp/core/model/pharmacies/Manufacturer.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';

import '../../final_products_page.dart';

class ManufacturerItem extends StatelessWidget {
  final Manufacturer item;

  ManufacturerItem(this.item);

  @override
  Widget build(BuildContext context) {
    return InkWell(
      onTap: () {
        Navigator.push(
          context,
          FadePage(
            page: FinalProductsPage(
              id: item.id,
              productType: 2,
            ),
          ),
        );
      },
      child: Container(
        width: 100,
        margin: EdgeInsets.symmetric(
          horizontal: 12,
          vertical: 4,
        ),
        decoration: BoxDecoration(
          borderRadius:BorderRadius.circular(12) ,
          border: Border(
              right: BorderSide(color: Colors.grey.shade300, width: 1),
              bottom: BorderSide(color: Colors.grey.shade300, width: 1),
              left: BorderSide(color: Colors.grey.shade300, width: 1),
              top: BorderSide(color: Colors.grey.shade300, width: 1)),
        ),
        child: item.image == null
            ? Container(
              padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 10),
              alignment: Alignment.topCenter,
              child: AppText(item.name, fontWeight: FontWeight.w500,fontSize: 14,),
            )
            : Padding(
                padding: EdgeInsets.symmetric(horizontal: 8),
                child: Image.network(
                  item.image.src,
                  fit: BoxFit.cover,
                ),
              ),
      ),
    );
  }
}
