fecha en mensajes y lista profesional

This commit is contained in:
Felipe
2024-05-25 10:09:54 -05:00
parent f1b2497c92
commit 0e93bc23b8
2 changed files with 81 additions and 51 deletions
+57 -46
View File
@@ -81,55 +81,64 @@ class _ProfessionalListScreenState extends State<ProfessionalListScreen> {
children: [
_isLoading
? _buildShimmerEffect()
: Container(
padding: const EdgeInsets.symmetric(horizontal: 20),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Colors.grey[400]!,
: _selectedProfession == null
? Container(
padding: const EdgeInsets.symmetric(horizontal: 20),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Colors.grey[400]!,
),
),
),
child: DropdownButtonHideUnderline(
child: DropdownButton<String>(
isExpanded: true,
value: _selectedProfession,
hint: const Text('Seleccione una profesión'),
items: _filteredProfessions
?.map((String profession) {
return DropdownMenuItem<String>(
value: profession,
child: Text(profession),
);
}).toList(),
onChanged: (String? newValue) {
setState(() {
_selectedProfession = newValue;
});
},
),
),
)
: Container(),
_selectedProfession != null
? TextField(
controller: _searchController,
onChanged: (value) {
setState(() {
_searchController.text = value;
});
},
decoration: const InputDecoration(
hintText: 'Busca un profesional',
prefixIcon: Icon(Icons.search),
enabledBorder: UnderlineInputBorder(
borderSide: BorderSide(color: Colors.grey),
),
focusedBorder: UnderlineInputBorder(
borderSide: BorderSide(color: Colors.grey),
),
),
child: DropdownButtonHideUnderline(
child: DropdownButton<String>(
isExpanded: true,
value: _selectedProfession,
hint: const Text('Seleccione una profesión'),
items:
_filteredProfessions?.map((String profession) {
return DropdownMenuItem<String>(
value: profession,
child: Text(profession),
);
}).toList(),
onChanged: (String? newValue) {
setState(() {
_selectedProfession = newValue;
});
},
),
),
),
TextField(
controller: _searchController,
onChanged: (value) {
setState(() {
_searchController.text = value;
});
},
decoration: const InputDecoration(
hintText: 'Busca un profesional',
prefixIcon: Icon(Icons.search),
enabledBorder: UnderlineInputBorder(
borderSide: BorderSide(color: Colors.grey),
),
focusedBorder: UnderlineInputBorder(
borderSide: BorderSide(color: Colors.grey),
),
),
),
)
: Container(),
Expanded(
child: _body(state),
child: _selectedProfession != null
? _body(state)
: const Center(
child: Text(
'Agrega los filtros para ver los profesionales'),
),
),
],
),
@@ -151,6 +160,8 @@ class _ProfessionalListScreenState extends State<ProfessionalListScreen> {
.contains(removeDiacritics(_searchController.text.toLowerCase())))
.where((user) =>
user.myUser.id != FirebaseAuth.instance.currentUser!.uid)
.where(
(user) => user.professionalInfo.profession == _selectedProfession)
.toList();
// } else {
// filteredUsers = state.users
@@ -160,7 +171,7 @@ class _ProfessionalListScreenState extends State<ProfessionalListScreen> {
if (filteredUsers.isEmpty) {
return const Center(
child: Text('No hay profesionales'),
child: Text('Ningun profesional coincide con la busqueda'),
);
}