fixes
							parent
							
								
									f15018b0e8
								
							
						
					
					
						commit
						fdd5d4cf6d
					
				| @ -0,0 +1,44 @@ | |||||||
|  | import 'package:flutter/material.dart'; | ||||||
|  | 
 | ||||||
|  | class ProfileSelector extends StatelessWidget { | ||||||
|  |   final List<Map<String, dynamic>> profiles; | ||||||
|  |   final Function(Map<String, dynamic>) onSelect; | ||||||
|  | 
 | ||||||
|  |   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"]) | ||||||
|  |                 : AssetImage( | ||||||
|  |                 profile["Gender"] == 1 | ||||||
|  |                     ? "assets/images/male.png" | ||||||
|  |                     : "assets/images/female.png") | ||||||
|  |             as ImageProvider, | ||||||
|  |           ), | ||||||
|  |           title: Text( | ||||||
|  |             profile["PatientName"] ?? "Unknown", | ||||||
|  |             style: const TextStyle(fontWeight: FontWeight.w600), | ||||||
|  |           ), | ||||||
|  |           subtitle: Text( | ||||||
|  |             profile["Relationship"] ?? "Self", | ||||||
|  |             style: const TextStyle(color: Colors.grey), | ||||||
|  |           ), | ||||||
|  |           trailing: const Icon(Icons.arrow_forward_ios, size: 16), | ||||||
|  |           onTap: () => onSelect(profile), | ||||||
|  |         ); | ||||||
|  |       }).toList(), | ||||||
|  |     ); | ||||||
|  |   } | ||||||
|  | } | ||||||
| @ -0,0 +1,15 @@ | |||||||
|  | import 'package:flutter/material.dart'; | ||||||
|  | import '../common_bottom_sheet.dart'; | ||||||
|  | import 'my_Family.dart'; | ||||||
|  |  class MyFamilySheet { | ||||||
|  |    static void show(BuildContext context, List<Map<String, dynamic>> profiles, Function(Map<String, dynamic>) onSelect) { | ||||||
|  |      showCommonBottomSheetWithoutHeight( | ||||||
|  |        context, | ||||||
|  |        title: 'Select Profile', | ||||||
|  |        child: ProfileSelector(profiles: profiles, onSelect: (profile) { | ||||||
|  |          Navigator.of(context).pop(); // Close the bottom sheet | ||||||
|  |          onSelect(profile); // Call the onSelect callback | ||||||
|  |        }), callBackFunc: () {}, | ||||||
|  |      ); | ||||||
|  |    } | ||||||
|  |  } | ||||||
					Loading…
					
					
				
		Reference in New Issue