1import 'package:easy_localization/easy_localization.dart';
2import 'package:flutter/material.dart';
3import 'package:flutter_bloc/flutter_bloc.dart';
4import 'package:flutter_screenutil/flutter_screenutil.dart';
5import 'package:shimmer/shimmer.dart';
6import '../../../../../../core/ui/theme/color_palette.dart';
7import '../../../../domain/entities/res/res_collection_contact_entity.dart';
8import '../../../bloc/collections_information_bloc/collections_information_bloc.dart';
16 this.selectedContactId,
17 required this.onChanged,
21 Widget
build(BuildContext context) {
22 return BlocBuilder<CollectionsInformationBloc, CollectionsInformationState>(
23 buildWhen: (previous, current) =>
24 current is CollectionContactListLoading ||
27 builder: (context,
state) {
28 if (
state is CollectionContactListLoading) {
41 if (
state.contacts.isEmpty) {
55 crossAxisAlignment: CrossAxisAlignment.start,
58 baseColor: Colors.grey[300]!,
59 highlightColor: Colors.grey[100]!,
63 decoration: BoxDecoration(
65 borderRadius: BorderRadius.circular(4.sp),
71 baseColor: Colors.grey[300]!,
72 highlightColor: Colors.grey[100]!,
75 decoration: BoxDecoration(
77 borderRadius: BorderRadius.circular(20.sp),
86 final validContacts =
contacts.where((contact) =>
87 contact.reference != null && contact.reference!.isNotEmpty
91 crossAxisAlignment: CrossAxisAlignment.start,
94 'full_fill_collection.contact'.tr(),
102 decoration: BoxDecoration(
103 borderRadius: BorderRadius.circular(20.sp),
107 child: DropdownButtonHideUnderline(
108 child: DropdownButton<int>(
112 'full_fill_collection.select_contact'.tr(),
113 style: TextStyle(fontSize: 14.sp),
116 padding: EdgeInsets.symmetric(horizontal: 16.sp),
117 borderRadius: BorderRadius.circular(8.sp),
118 items: validContacts.map((contact) {
119 return DropdownMenuItem<int>(
122 contact.reference ??
'',
123 style: TextStyle(fontSize: 14.sp),
style Text( '${ 'scheduling.reference'.tr()}:${collection.internalCode}', style:Theme.of(context).textTheme.bodySmall,)
style SizedBox(height:2.h)
style Column(crossAxisAlignment:CrossAxisAlignment.end, children:[Container(padding:EdgeInsets.symmetric(horizontal:8.w, vertical:4.h), decoration:BoxDecoration(color:ColorPalette.tiffanyBlue.withValues(alpha:0.1), borderRadius:BorderRadius.circular(12),), child:Text(collection.type ?? '', style:Theme.of(context).textTheme.bodySmall?.copyWith(color:ColorPalette.tiffanyBlue, fontWeight:FontWeight.bold,),),),],)