-
Notifications
You must be signed in to change notification settings - Fork 0
/
doctorCard.dart
92 lines (87 loc) · 2.51 KB
/
doctorCard.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:url_launcher/url_launcher.dart';
import '../../../shared/appColors.dart';
class DoctorCard extends StatelessWidget {
const DoctorCard({
Key? key,
required this.name,
required this.desc,
required this.availability,
required this.image,
required this.phoneNo,
}) : super(key: key);
final String name, desc, availability, image;
final int phoneNo;
_makePhoneCall(int phoneNo) async {
var url = Uri.parse('tel:$phoneNo');
await launchUrl(url);
}
@override
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
padding: EdgeInsets.all(16),
margin: EdgeInsets.symmetric(vertical: 4),
child: Row(
children: [
Container(
width: 52,
height: 52,
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage(image),
fit: BoxFit.cover,
),
borderRadius: BorderRadius.circular(30)
),
),
const SizedBox(width: 16,),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
name,
style: GoogleFonts.lato(
textStyle: const TextStyle(
fontSize: 17,
color: AppColors.primaryBlackColor
)
),
),
const SizedBox(height: 4,),
Text(
desc,
style: GoogleFonts.lato(
textStyle: const TextStyle(
fontSize: 13,
color: AppColors.infoGreyColor
)
),
),
Text(
availability,
style: GoogleFonts.lato(
textStyle: const TextStyle(
fontSize: 13,
color: AppColors.infoGreyColor
)
),
),
],
),
const Spacer(),
IconButton(
icon: const Icon(Icons.call, color: AppColors.greenColor,),
onPressed: () async {
await _makePhoneCall(phoneNo);
},
)
],
),
);
}
}