mirrored_repositories/pizza-animation/lib
import 'package:pizza_animation/screens/diy_pizza_screen.dart';
import 'package:pizza_animation/services/size_config.dart';
import 'package:pizza_animation/utils/constants.dart';
import 'package:flutter/material.dart';

class Ingridient extends StatelessWidget {
  final Ingridients path;
  const Ingridient({Key? key, required this.path}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Draggable<Ingridients>(
      data: path,
      child: Image(
        image: AssetImage(getIngridientsPath(path)),
        height: 50.toHeight,
        width: 50.toWidth,
      ),
      feedback: Image(
        image: AssetImage(getIngridientsPath(path)),
        height: 50.toHeight,
        width: 50.toWidth,
      ),
      childWhenDragging: Container(),
    );
  }

  getIngridientsPath(Ingridients ingridient) {
    if (ingridient == Ingridients.BASIL)
      return Constants.BASIL[0];
    else if (ingridient == Ingridients.BROCCOLI)
      return Constants.BROCCOLI[0];
    else if (ingridient == Ingridients.MASHROOM)
      return Constants.MASHROOM[5];
    else if (ingridient == Ingridients.ONION)
      return Constants.ONION[0];
    else if (ingridient == Ingridients.SAUSAGE) return Constants.SAUSAGE[0];
  }
}
