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.
179 lines
7.6 KiB
Dart
179 lines
7.6 KiB
Dart
4 years ago
|
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/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<AskDoctorViewModel>(
|
||
|
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(
|
||
|
header: Padding(
|
||
|
padding: const EdgeInsets.all(8.0),
|
||
|
child: Row(
|
||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||
|
children: [
|
||
|
Texts('New'),
|
||
|
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(
|
||
|
header: Padding(
|
||
|
padding: const EdgeInsets.all(8.0),
|
||
|
child: Row(
|
||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||
|
children: [
|
||
|
Texts('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(),
|
||
|
),
|
||
|
),
|
||
|
],
|
||
|
),
|
||
|
),
|
||
|
),
|
||
|
),
|
||
|
);
|
||
|
}
|
||
|
}
|