update design my schedule and doctor replay
parent
7f5831335b
commit
7d3bfddd68
@ -0,0 +1,177 @@
|
|||||||
|
import 'package:doctor_app_flutter/config/size_config.dart';
|
||||||
|
import 'package:doctor_app_flutter/models/list_gt_my_pationents_question_model.dart';
|
||||||
|
import 'package:doctor_app_flutter/util/helpers.dart';
|
||||||
|
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/patients/profile/large_avatar.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:hexcolor/hexcolor.dart';
|
||||||
|
|
||||||
|
class DoctorReplyWidget extends StatefulWidget {
|
||||||
|
final ListGtMyPatientsQuestions reply;
|
||||||
|
bool isShowMore = false;
|
||||||
|
|
||||||
|
DoctorReplyWidget({Key key, this.reply});
|
||||||
|
|
||||||
|
@override
|
||||||
|
_DoctorReplyWidgetState createState() => _DoctorReplyWidgetState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _DoctorReplyWidgetState extends State<DoctorReplyWidget> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Stack(
|
||||||
|
children: <Widget>[
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.symmetric(vertical: 10.0),
|
||||||
|
width: double.infinity,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Hexcolor('#FFFFFF'),
|
||||||
|
borderRadius: BorderRadius.all(
|
||||||
|
Radius.circular(20.0),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Container(
|
||||||
|
margin: EdgeInsets.all(5),
|
||||||
|
child: Column(
|
||||||
|
children: <Widget>[
|
||||||
|
SizedBox(height: 18,),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.only(right: 15),
|
||||||
|
child: Row(
|
||||||
|
children: <Widget>[
|
||||||
|
SizedBox(width: 5,),
|
||||||
|
LargeAvatar(name: widget.reply.patientName,url: '',),
|
||||||
|
SizedBox(width: 15,),
|
||||||
|
Expanded(
|
||||||
|
child: Container(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
AppText(
|
||||||
|
widget.reply.patientName,
|
||||||
|
fontSize: 1.5 * SizeConfig.textMultiplier,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 5,
|
||||||
|
),
|
||||||
|
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
AppText(
|
||||||
|
TranslationBase.of(context).fileNo,
|
||||||
|
fontSize: 1.7 * SizeConfig.textMultiplier,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.only(left: 5),
|
||||||
|
child: AppText(
|
||||||
|
'${widget.reply.patientID}',
|
||||||
|
fontSize: 1.7 * SizeConfig.textMultiplier,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 5,
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
AppText(
|
||||||
|
TranslationBase.of(context).mobileNo,
|
||||||
|
fontSize: 1.7 * SizeConfig.textMultiplier,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.only(left: 5),
|
||||||
|
child: AppText(
|
||||||
|
widget.reply.mobileNumber,
|
||||||
|
fontSize: 1.7 * SizeConfig.textMultiplier,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 5,
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
width: 70,
|
||||||
|
height: 20,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(60.0)),
|
||||||
|
color: Colors.green[600]
|
||||||
|
),
|
||||||
|
child: Center(
|
||||||
|
child: AppText(
|
||||||
|
widget.reply.requestTime,
|
||||||
|
fontSize: 1.5 * SizeConfig.textMultiplier,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
|
||||||
|
child: AppText(
|
||||||
|
'${Helpers.getDate(widget.reply.requestDate)}',
|
||||||
|
fontSize: 1.7 * SizeConfig.textMultiplier,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: Colors.black,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
!widget.isShowMore ? SizedBox(height: 18,) :
|
||||||
|
AnimatedContainer(
|
||||||
|
duration: Duration(milliseconds: 200),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: <Widget>[
|
||||||
|
Divider(color: Colors.grey),
|
||||||
|
SizedBox(height: 5,),
|
||||||
|
AppText(
|
||||||
|
widget.reply.remarks,
|
||||||
|
fontSize: 2.5 * SizeConfig.textMultiplier,
|
||||||
|
//fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
SizedBox(height: 10,)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Positioned(
|
||||||
|
right: 5,
|
||||||
|
top: 20,
|
||||||
|
child: InkWell(
|
||||||
|
onTap: (){
|
||||||
|
setState(() {
|
||||||
|
widget.isShowMore = !widget.isShowMore;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
child: Icon(widget.isShowMore? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down)),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,79 @@
|
|||||||
|
import 'package:doctor_app_flutter/config/size_config.dart';
|
||||||
|
import 'package:doctor_app_flutter/models/list_doctor_working_hours_table_model.dart';
|
||||||
|
import 'package:doctor_app_flutter/util/helpers.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class MyScheduleWidget extends StatelessWidget {
|
||||||
|
final ListDoctorWorkingHoursTable workingHoursTable;
|
||||||
|
|
||||||
|
MyScheduleWidget({Key key, this.workingHoursTable});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
List<WorkingHours> workingHours = Helpers.getWorkingHours(workingHoursTable.workingHours);
|
||||||
|
return CardWithBgWidgetNew(
|
||||||
|
widget: Container(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: <Widget>[
|
||||||
|
Row(
|
||||||
|
children: <Widget>[
|
||||||
|
AppText(workingHoursTable.dayName,
|
||||||
|
fontSize: 2.5 * SizeConfig.textMultiplier),
|
||||||
|
AppText(
|
||||||
|
' ${workingHoursTable.date.day}/${workingHoursTable.date.month}/${workingHoursTable.date.year}',
|
||||||
|
fontSize: 2.2 * SizeConfig.textMultiplier,fontWeight: FontWeight.w300,),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 8,
|
||||||
|
),
|
||||||
|
Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: workingHours.map((work) {
|
||||||
|
return Container(
|
||||||
|
child: Column(
|
||||||
|
children: <Widget>[
|
||||||
|
Divider(color: Colors.grey),
|
||||||
|
Row(
|
||||||
|
children: <Widget>[
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: <Widget>[
|
||||||
|
AppText('From',fontSize: 2.2 * SizeConfig.textMultiplier,fontWeight: FontWeight.bold,),
|
||||||
|
AppText(work.from,fontSize: 2.2 * SizeConfig.textMultiplier,fontWeight: FontWeight.w300,)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(height: SizeConfig.realScreenWidth * 0.1 ,width: 0.8,color: Colors.grey,
|
||||||
|
margin: EdgeInsets.only(left: 15,right: 15),),
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: <Widget>[
|
||||||
|
AppText('To',fontSize: 2.2 * SizeConfig.textMultiplier,fontWeight: FontWeight.bold,),
|
||||||
|
AppText(work.to,fontSize: 2.2 * SizeConfig.textMultiplier,fontWeight: FontWeight.w300,)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}).toList(),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: 8,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,42 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class AvatarGradients{
|
||||||
|
static List<Color> getGradients (String name) {
|
||||||
|
|
||||||
|
int code = (name?.length ?? 0) > 0 ? name.toUpperCase()[0].codeUnits[0] : 1;
|
||||||
|
code += (name?.length ?? 0) > 1 ? name.toUpperCase()[1].codeUnits[0] : 0;
|
||||||
|
|
||||||
|
List<List<Color>> colors = [
|
||||||
|
[
|
||||||
|
Color.fromRGBO(150, 222, 218, 1.0),
|
||||||
|
Color.fromRGBO(80, 201, 195, 1.0),
|
||||||
|
],
|
||||||
|
[
|
||||||
|
Color.fromRGBO(102, 126, 254, 1.0),
|
||||||
|
Color.fromRGBO(148, 75, 192, 1.0),
|
||||||
|
],
|
||||||
|
[
|
||||||
|
Color.fromRGBO(255, 177, 153, 1.0),
|
||||||
|
Color.fromRGBO(255, 8, 68, 1.0),
|
||||||
|
],
|
||||||
|
[
|
||||||
|
Color.fromRGBO(100, 210, 255, 1.0),
|
||||||
|
Color.fromRGBO(10, 60, 255, 1.0),
|
||||||
|
],
|
||||||
|
[
|
||||||
|
Color.fromRGBO(83, 120, 149, 1.0),
|
||||||
|
Color.fromRGBO(9, 32, 63, 1.0),
|
||||||
|
],
|
||||||
|
[
|
||||||
|
Color.fromRGBO(48, 210, 190, 1.0),
|
||||||
|
Color.fromRGBO(53, 132, 167, 1.0),
|
||||||
|
],
|
||||||
|
[
|
||||||
|
Color.fromRGBO(255, 179, 169, 1.0),
|
||||||
|
Color.fromRGBO(245, 103, 144, 1.0),
|
||||||
|
]
|
||||||
|
];
|
||||||
|
|
||||||
|
return colors[code % colors.length];
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,74 @@
|
|||||||
|
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
import 'avatar_gradients.dart';
|
||||||
|
|
||||||
|
class LargeAvatar extends StatelessWidget {
|
||||||
|
LargeAvatar({Key key, this.name, this.url, this.disableProfileView: false})
|
||||||
|
: super(key: key);
|
||||||
|
|
||||||
|
final String name;
|
||||||
|
final String url;
|
||||||
|
final bool disableProfileView;
|
||||||
|
|
||||||
|
Widget _getAvatar() {
|
||||||
|
if (url != null && url.isNotEmpty && Uri.parse(url).isAbsolute) {
|
||||||
|
return Center(
|
||||||
|
child: ClipRRect(
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(60.0)),
|
||||||
|
child: Image.network(
|
||||||
|
url.trim(),
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
width: 90.0,
|
||||||
|
height: 90.0,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
} else if (name == null || name.isEmpty) {
|
||||||
|
return Center(
|
||||||
|
child: AppText(
|
||||||
|
'DR',
|
||||||
|
color: Colors.white,
|
||||||
|
));
|
||||||
|
} else {
|
||||||
|
return Center(
|
||||||
|
child: AppText(
|
||||||
|
name[0].toUpperCase(),
|
||||||
|
color: Colors.white,fontSize: 18,fontWeight: FontWeight.bold,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return InkWell(
|
||||||
|
onTap: disableProfileView
|
||||||
|
? null
|
||||||
|
: () {
|
||||||
|
//TODO when we need that
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
gradient: LinearGradient(
|
||||||
|
begin: Alignment(-1, -1),
|
||||||
|
end: Alignment(1, 1),
|
||||||
|
colors: [
|
||||||
|
Colors.grey[100],
|
||||||
|
Colors.grey[800],
|
||||||
|
]
|
||||||
|
),
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: Color.fromRGBO(0, 0, 0, 0.08),
|
||||||
|
offset: Offset(0.0, 5.0),
|
||||||
|
blurRadius: 16.0)
|
||||||
|
],
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(50.0)),
|
||||||
|
),
|
||||||
|
width: 90.0,
|
||||||
|
height: 90.0,
|
||||||
|
child: _getAvatar()),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue