import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/dependencies.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/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/presentation/my_family/widget/family_cards.dart';
import 'package:hmg_patient_app_new/services/navigation_service.dart';
import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/common_bottom_sheet.dart';

class MyFamilySheet {
  static Future<void> show(BuildContext context, List<FamilyFileResponseModelLists> familyLists, Function(FamilyFileResponseModelLists) onSelect) async {
    NavigationService navigationService = getIt<NavigationService>();
    return showCommonBottomSheetWithoutHeight(
      context,
      titleWidget: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          LocaleKeys.selectAProfile.tr(context: context).toText21(isBold: true),
          LocaleKeys.switchFamilyFile.tr(context: context).toText16(weight: FontWeight.w100, color: AppColors.greyTextColor),
        ],
      ),
      child: FamilyCards(
          profiles: familyLists,
          onSelect: (profile) {
            navigationService.pop();
            onSelect(profile);
          },
          onRemove: (profile) {},
          isBottomSheet: true),
      callBackFunc: () {},
    );
  }
}
