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.
164 lines
5.9 KiB
Dart
164 lines
5.9 KiB
Dart
import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart';
|
|
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
|
import 'package:diplomaticquarterapp/widgets/others/StarRating.dart';
|
|
import 'package:diplomaticquarterapp/widgets/others/rounded_container_widget.dart';
|
|
import 'package:flutter/cupertino.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
|
|
|
class DoctorCard extends StatelessWidget {
|
|
final String name;
|
|
final String subName;
|
|
final double rat;
|
|
final String date;
|
|
final String profileUrl;
|
|
final String billNo;
|
|
final Function onTap;
|
|
final Function onEmailTap;
|
|
|
|
final String isInOutPatientDescription;
|
|
|
|
DoctorCard(
|
|
{this.name,
|
|
this.subName,
|
|
this.rat,
|
|
this.date,
|
|
this.profileUrl,
|
|
this.billNo,
|
|
this.onTap,
|
|
this.onEmailTap,
|
|
this.isInOutPatientDescription});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Container(
|
|
margin: EdgeInsets.all(10),
|
|
decoration: BoxDecoration(
|
|
border: Border.all(
|
|
width: 0.5,
|
|
color: Theme.of(context).primaryColor,
|
|
),
|
|
borderRadius: BorderRadius.all(
|
|
Radius.circular(8.0),
|
|
),
|
|
color: Colors.white
|
|
),
|
|
child: InkWell(
|
|
onTap: onTap,
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: <Widget>[
|
|
Row(
|
|
children: <Widget>[
|
|
Container(
|
|
width: 20,
|
|
height: date == null ? 100 : 130,
|
|
decoration: BoxDecoration(
|
|
color: Colors.red[900],
|
|
borderRadius: BorderRadius.only(
|
|
topLeft: Radius.circular(8),
|
|
bottomLeft: Radius.circular(8))),
|
|
child: RotatedBox(
|
|
quarterTurns: 3,
|
|
child: Center(
|
|
child: Text(
|
|
isInOutPatientDescription ?? "Calendar",
|
|
style: TextStyle(color: Colors.white),
|
|
),
|
|
)),
|
|
),
|
|
Expanded(
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: <Widget>[
|
|
Padding(
|
|
padding: const EdgeInsets.all(10.0),
|
|
child: Row(
|
|
children: <Widget>[
|
|
Expanded(
|
|
flex: 1,
|
|
child: LargeAvatar(
|
|
name: name,
|
|
url: profileUrl,
|
|
),
|
|
),
|
|
Expanded(
|
|
flex: 4,
|
|
child: Container(
|
|
margin: EdgeInsets.all(10),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: <Widget>[
|
|
Texts(
|
|
name,
|
|
bold: true,
|
|
),
|
|
Texts(
|
|
subName,
|
|
variant: 'caption3',
|
|
),
|
|
if (billNo != null)
|
|
Row(
|
|
children: <Widget>[
|
|
Texts(
|
|
'Bill No: ',
|
|
variant: 'caption3',
|
|
),
|
|
Texts(
|
|
billNo,
|
|
variant: 'caption3',
|
|
)
|
|
],
|
|
),
|
|
if (rat != null)
|
|
StarRating(
|
|
totalAverage: rat, forceStars: true),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
if(onEmailTap!=null)
|
|
InkWell(
|
|
onTap: onEmailTap,
|
|
child: Icon(
|
|
Icons.email,
|
|
color: Colors.red,
|
|
),
|
|
)
|
|
],
|
|
),
|
|
),
|
|
if (date != null)
|
|
Divider(
|
|
height: 8,
|
|
color: Colors.grey[400],
|
|
),
|
|
if (date != null)
|
|
Row(
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
children: <Widget>[
|
|
Image.asset(
|
|
'assets/images/Icon-awesome-calendar.png',
|
|
width: 30,
|
|
height: 30,
|
|
),
|
|
Expanded(
|
|
child: Texts(
|
|
date,
|
|
variant: 'bodyText',
|
|
),
|
|
)
|
|
],
|
|
)
|
|
],
|
|
),
|
|
)
|
|
],
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|