import 'package:diplomaticquarterapp/core/viewModels/medical/ask_doctor_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'ViewDoctorResponsesPage.dart'; class DoctorResponse extends StatelessWidget { @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getDoctorResponse(), builder: (_, model, w) => AppScaffold( baseViewModel: model, body: SingleChildScrollView( child: Container( margin: EdgeInsets.all(12), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( height: 65, ), AppExpandableNotifier( headerWidget: Padding( padding: const EdgeInsets.all(8.0), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Texts(TranslationBase.of(context).newDes), Container( width: 30, height: 30, decoration: BoxDecoration( shape: BoxShape.circle, color: Colors.red[800], ), child: Center( child: Texts( '${model.doctorResponseList.length}', color: Colors.white, ), ), ) ], ), ), bodyWidget: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceBetween, children: model.doctorResponseList.map( (doctor) { return InkWell( onTap: () { ///go to page ViewDoctorResponsesPage Navigator.push( context, FadePage( page: ViewDoctorResponsesPage( doctorResponse: doctor, ), ), ); }, child: Container( height: 70, margin: EdgeInsets.only(top: 8, bottom: 8), decoration: BoxDecoration( borderRadius: BorderRadius.circular(8), color: Colors.white, border: Border.all(color: Colors.grey[300]), ), child: Row( mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ Expanded( child: Padding( padding: const EdgeInsets.all(8.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts('${doctor.doctorName}'), SizedBox( height: 5, ), Texts( '${doctor.requestTypeDescription}'), ], ), ), ), Icon(projectViewModel.isArabic ? Icons.arrow_forward_ios : Icons.arrow_back_ios) ], ), ), ); }, ).toList(), ), ), AppExpandableNotifier( headerWidget: Padding( padding: const EdgeInsets.all(8.0), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Texts(TranslationBase.of(context).all), Container( width: 30, height: 30, decoration: BoxDecoration( shape: BoxShape.circle, color: Colors.red[800], ), child: Center( child: Texts( '${model.doctorResponseList.length}', color: Colors.white, ), ), ) ], ), ), bodyWidget: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceBetween, children: model.doctorResponseList.map( (doctor) { return InkWell( onTap: () {}, child: Container( height: 70, margin: EdgeInsets.only(top: 8, bottom: 8), decoration: BoxDecoration( borderRadius: BorderRadius.circular(8), color: Colors.white, border: Border.all(color: Colors.grey[300]), ), child: Row( mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ Expanded( child: Padding( padding: const EdgeInsets.all(8.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts('${doctor.doctorName}'), SizedBox( height: 5, ), Texts( '${doctor.requestTypeDescription}'), ], ), ), ), Icon(projectViewModel.isArabic ? Icons.arrow_forward_ios : Icons.arrow_back_ios) ], ), ), ); }, ).toList(), ), ), ], ), ), ), ), ); } }