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.
182 lines
8.2 KiB
Dart
182 lines
8.2 KiB
Dart
import 'package:diplomaticquarterapp/core/model/doctor/patient_doctor_appointment.dart';
|
|
import 'package:diplomaticquarterapp/core/viewModels/medical/my_doctor_view_model.dart';
|
|
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
|
import 'package:flutter/cupertino.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:rating_bar/rating_bar.dart';
|
|
|
|
import 'doctor_information_page.dart';
|
|
|
|
class DoctorProfilePage extends StatefulWidget {
|
|
final PatientDoctorAppointment patientDoctorAppointment;
|
|
|
|
DoctorProfilePage({this.patientDoctorAppointment});
|
|
|
|
@override
|
|
_DoctorProfilePageState createState() =>
|
|
_DoctorProfilePageState(patientDoctorAppointment);
|
|
}
|
|
|
|
class _DoctorProfilePageState extends State<DoctorProfilePage>
|
|
with SingleTickerProviderStateMixin {
|
|
TabController _tabController;
|
|
final PatientDoctorAppointment patientDoctorAppointment;
|
|
|
|
_DoctorProfilePageState(this.patientDoctorAppointment);
|
|
|
|
@override
|
|
void initState() {
|
|
_tabController = new TabController(length: 2, vsync: this);
|
|
super.initState();
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return BaseView<MyDoctorViewModel>(
|
|
onModelReady: (model) => model.getDoctorProfileAndRating(
|
|
doctorId: widget.patientDoctorAppointment.doctorID,
|
|
clinicID: widget.patientDoctorAppointment.clinicID,
|
|
projectID: widget.patientDoctorAppointment.projectID),
|
|
builder: (context, model, widget) => AppScaffold(
|
|
isShowAppBar: true,
|
|
appBarTitle: 'Doctor Profile',
|
|
baseViewModel: model,
|
|
body: SingleChildScrollView(
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: <Widget>[
|
|
Container(
|
|
color: Colors.white,
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: <Widget>[
|
|
Container(
|
|
margin: EdgeInsets.only(top: 20.0),
|
|
child: Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
children: <Widget>[
|
|
Container(
|
|
margin: EdgeInsets.all(5),
|
|
width: 50,
|
|
height: 50,
|
|
decoration:
|
|
BoxDecoration(shape: BoxShape.circle,
|
|
color: Colors.grey
|
|
),
|
|
child: Icon(
|
|
Icons.calendar_view_day,
|
|
size: 25,
|
|
color: Colors.white,
|
|
)),
|
|
ClipRRect(
|
|
borderRadius: BorderRadius.circular(100.0),
|
|
child: Image.network(
|
|
patientDoctorAppointment.doctorImageURL,
|
|
fit: BoxFit.fill,
|
|
height: 120.0,
|
|
width: 120.0),
|
|
),
|
|
Container(
|
|
margin: EdgeInsets.all(5),
|
|
width: 50,
|
|
height: 50,
|
|
decoration:
|
|
BoxDecoration(shape: BoxShape.circle,
|
|
color: Colors.grey
|
|
),
|
|
child: Icon(
|
|
Icons.format_list_bulleted,
|
|
size: 25,
|
|
color: Colors.white,
|
|
)),
|
|
],
|
|
),
|
|
),
|
|
Container(
|
|
margin: EdgeInsets.only(top: 10.0),
|
|
alignment: Alignment.center,
|
|
child: Text(patientDoctorAppointment.doctorName,
|
|
style: TextStyle(
|
|
fontSize: 20.0,
|
|
color: Colors.grey[900],
|
|
letterSpacing: 1.0)),
|
|
),
|
|
Container(
|
|
margin: EdgeInsets.only(top: 10.0),
|
|
alignment: Alignment.center,
|
|
child: Text(patientDoctorAppointment.clinicName,
|
|
style: TextStyle(
|
|
fontSize: 12.0,
|
|
color: Colors.grey[900],
|
|
letterSpacing: 1.0)),
|
|
),
|
|
Container(
|
|
margin: EdgeInsets.only(top: 5.0),
|
|
alignment: Alignment.center,
|
|
child: RatingBar.readOnly(
|
|
initialRating:
|
|
model.doctorRating.doctorRate.toDouble() ??
|
|
0.0,
|
|
size: 35.0,
|
|
filledColor: Colors.yellow[700],
|
|
emptyColor: Colors.grey[500],
|
|
isHalfAllowed: true,
|
|
halfFilledIcon: Icons.star_half,
|
|
filledIcon: Icons.star,
|
|
emptyIcon: Icons.star,
|
|
),
|
|
),
|
|
Container(
|
|
margin: EdgeInsets.only(top: 5.0),
|
|
alignment: Alignment.center,
|
|
child: Text(
|
|
"(${model.doctorRating.patientNumber ?? 0} Reviews)",
|
|
style: TextStyle(
|
|
fontSize: 14.0,
|
|
color: Colors.blue[800],
|
|
letterSpacing: 1.0,
|
|
decoration: TextDecoration.underline,
|
|
)),
|
|
),
|
|
Container(
|
|
margin: EdgeInsets.only(top: 10.0),
|
|
child: Divider(
|
|
color: Colors.grey[500],
|
|
),
|
|
),
|
|
TabBar(
|
|
indicatorColor: Colors.red[800],
|
|
indicatorWeight: 3.0,
|
|
tabs: [
|
|
Tab(
|
|
child: Text(
|
|
'Doctor Information',
|
|
style: TextStyle(color: Colors.black))),
|
|
Tab(
|
|
child: Text(
|
|
TranslationBase.of(context).availableAppo,
|
|
style: TextStyle(color: Colors.black)),
|
|
)
|
|
],
|
|
controller: _tabController,
|
|
),
|
|
Container(
|
|
height: MediaQuery.of(context).size.height * 0.8,
|
|
child: TabBarView(
|
|
physics: BouncingScrollPhysics(),
|
|
children: [DoctorInformation(doctorProfile: model.doctorProfile,), Container()],
|
|
controller: _tabController,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
));
|
|
}
|
|
}
|