import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/utils/utils.dart';
import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
import 'package:hmg_patient_app_new/features/medical_file/models/family_file_response_model.dart';
import 'package:hmg_patient_app_new/presentation/my_family/my_Family.dart';
import 'package:hmg_patient_app_new/presentation/my_family/widget/family_cards.dart';
import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/common_bottom_sheet.dart';

class MyFamilySheet {
  static void show(BuildContext context, List<FamilyFileResponseModelLists> familyLists, Function(FamilyFileResponseModelLists) onSelect) {
    return showCommonBottomSheetWithoutHeight(
      context,
      titleWidget: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          'Please select a profile'.toText21(isBold: true),
          'switch from the below list of medical file'.toText16(weight: FontWeight.w100, color: AppColors.greyTextColor),
        ],
      ),
      child: FamilyCards(
          profiles: familyLists,
          onSelect: (profile) {
            Navigator.of(context).pop(); // Close the bottom sheet
            onSelect(profile); // Call the onSelect callback
          },
          isBottomSheet: true),
      callBackFunc: () {},
    );
  }
}
