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.
100 lines
2.9 KiB
Dart
100 lines
2.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 Function onTap;
|
|
|
|
DoctorCard(
|
|
{this.name,
|
|
this.subName,
|
|
this.rat,
|
|
this.date,
|
|
this.profileUrl,
|
|
this.onTap});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return RoundedContainer(
|
|
child: InkWell(
|
|
onTap: onTap,
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: <Widget>[
|
|
Padding(
|
|
padding: const EdgeInsets.all(8.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: 'bodyText',
|
|
),
|
|
StarRating(totalAverage: rat, forceStars: true),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
|
|
Divider(
|
|
height: 8,
|
|
color: Colors.grey[400],
|
|
),
|
|
Padding(
|
|
padding: const EdgeInsets.all(5.0),
|
|
child: Row(
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
children: <Widget>[
|
|
SizedBox(
|
|
width: 10,
|
|
),
|
|
Image.asset(
|
|
'assets/images/Icon-awesome-calendar.png',
|
|
width: 30,
|
|
height: 30,
|
|
),
|
|
Expanded(
|
|
child: Texts(
|
|
date,
|
|
variant: 'bodyText',
|
|
),
|
|
)
|
|
],
|
|
),
|
|
)
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|