You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
HMG_Patient_App_New/lib/widgets/my_family/my_Family.dart

48 lines
1.5 KiB
Dart

2 months ago
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:hmg_patient_app_new/core/app_assets.dart';
import 'package:hmg_patient_app_new/features/medical_file/models/family_file_response_model.dart';
2 months ago
class ProfileSelector extends StatelessWidget {
final List<FamilyFileResponseModelLists> profiles;
final Function(FamilyFileResponseModelLists ) onSelect;
2 months ago
const ProfileSelector({
Key? key,
required this.profiles,
required this.onSelect,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Column(
mainAxisSize: MainAxisSize.min,
children: profiles.map((profile) {
return ListTile(
leading: CircleAvatar(
radius: 22,
backgroundImage: profile.genderImage != null &&
profile.genderImage.toString().isNotEmpty
? NetworkImage(profile.genderImage!)
2 months ago
: AssetImage(
profile.gender == 1
? AppAssets.male_img
: AppAssets.femaleImg)
2 months ago
as ImageProvider,
),
title: Text(
profile.patientName ?? "Unknown",
2 months ago
style: const TextStyle(fontWeight: FontWeight.w600),
),
subtitle: Text(
profile.relationship ?? "Self",
2 months ago
style: const TextStyle(color: Colors.grey),
),
trailing: const Icon(Icons.arrow_forward_ios, size: 16),
onTap: () => onSelect(profile),
);
}).toList(),
);
}
}