import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/widgets/expandable_bottom_sheet/model/BottomSheetType.dart';

class ExpandableBottomSheet extends StatelessWidget {
  final BottomSheetType bottomSheetType;
  final Map<BottomSheetType, Widget> children;

  const ExpandableBottomSheet(
      {super.key, required this.bottomSheetType, required this.children});

  @override
  Widget build(BuildContext context) {
  print("the currently selected item is $bottomSheetType");
    return AnimatedCrossFade(
      duration: const Duration(milliseconds: 600),
      firstChild:children[BottomSheetType.FIXED] ?? SizedBox.shrink(),
      secondChild: children[BottomSheetType.EXPANDED] ?? const SizedBox.shrink(),
      crossFadeState: BottomSheetType.FIXED == bottomSheetType ? CrossFadeState.showFirst : CrossFadeState.showSecond,
    );
    // switch (bottomSheetType) {
    //   case BottomSheetType.EXPANDED:
    //     return children[BottomSheetType.EXPANDED] ??
    //         SizedBox.shrink();
    //   case BottomSheetType.FIXED:
    //     return children[BottomSheetType.FIXED] ?? SizedBox.shrink();
    // }
    // return SizedBox.shrink();
  }
}
