getSPDetails method
Implementation
getSPDetails(
BuildContext context,
Data data,
) {
showModalBottomSheet<void>(
context: context,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(15.0),
),
backgroundColor: Colors.transparent,
builder: (BuildContext context) {
return Container(
height: SizeConstant.getHeightWithScreen(293),
padding: EdgeInsets.all(
SizeConstant.getHeightWithScreen(20),
),
decoration: BoxDecoration(
color: ColorConstant.white,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(
SizeConstant.getHeightWithScreen(15.0),
),
topRight: Radius.circular(
SizeConstant.getHeightWithScreen(15.0),
),
),
),
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
localization.translate('salesPersonDetails'),
style: TextStyle(
color: ColorConstant.black3,
fontSize: SizeConstant.largeFont,
fontWeight: FontWeight.w600,
),
),
GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Container(
height: SizeConstant.getHeightWithScreen(28),
width: SizeConstant.getHeightWithScreen(28),
decoration: BoxDecoration(
color: ColorConstant.white,
borderRadius: const BorderRadius.all(
Radius.circular(0),
),
),
child: Icon(
Icons.close,
color: ColorConstant.grey12,
size: SizeConstant.getHeightWithScreen(26),
),
),
),
],
),
SizedBox(
height: SizeConstant.getHeightWithScreen(20),
),
Container(
padding: EdgeInsets.only(top: SizeConstant.getHeightWithScreen(15), left: SizeConstant.getHeightWithScreen(16),
right: SizeConstant.getHeightWithScreen(16)),
decoration: BoxDecoration(
color: ColorConstant.white2,
border: Border.all(
color: ColorConstant.white2,
),
borderRadius: BorderRadius.circular(15),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
decoration: BoxDecoration(
color: ColorConstant.primaryColor,
borderRadius: BorderRadius.all(
Radius.circular(
SizeConstant.getHeightWithScreen(4.0),
),
),
),
height: SizeConstant.getHeightWithScreen(60),
width: SizeConstant.getHeightWithScreen(60),
child: Center(
child: Text(
getFirstLetterFromName(
data.firstName,
data.middleName,
data.lastName,
),
style: TextStyle(
overflow: TextOverflow.ellipsis,
fontSize: SizeConstant.xlargeFont,
fontWeight: FontWeight.w600,
color: ColorConstant.white,
),
),
),
),
SizedBox(
width: SizeConstant.getHeightWithScreen(10),
),
Expanded(
child: Text(
data.fullName ?? "-",
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
color: ColorConstant.black3,
fontSize: SizeConstant.smallFont,
fontWeight: FontWeight.w600,
),
),
),
],
),
),
Align(
alignment: Alignment.topRight,
child: Row(
children: [
GestureDetector(
onTap: () {
_launchPhoneCall(data.mobileNumber ?? "");
},
child: Image(
image: const AssetImage(
"assets/images/phone_call2.png",
package: Constants.packageName,
),
height: SizeConstant.getHeightWithScreen(27),
width: SizeConstant.getHeightWithScreen(27),
),
),
SizedBox(
width: SizeConstant.getHeightWithScreen(10),
),
GestureDetector(
onTap: () {
_launchWhatsApp(data.mobileNumber ?? "");
},
child: Image(
image: const AssetImage(
"assets/images/whatsapp.png",
package: Constants.packageName,
),
height: SizeConstant.getHeightWithScreen(27),
width: SizeConstant.getHeightWithScreen(27),
),
),
],
),
),
],
),
SizedBox(
height: SizeConstant.getHeightWithScreen(31),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
localization.translate('userId'),
style: TextStyle(
color: ColorConstant.grey12,
fontSize: SizeConstant.smallFont,
fontWeight: FontWeight.w500,
),
),
Text(
data.userId ?? "-",
style: TextStyle(
color: ColorConstant.black3,
fontSize: SizeConstant.smallFont,
fontWeight: FontWeight.w500,
),
)
],
),
SizedBox(
height: SizeConstant.getHeightWithScreen(12),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
localization.translate('mobileNumber'),
style: TextStyle(
color: ColorConstant.grey12,
fontSize: SizeConstant.smallFont,
fontWeight: FontWeight.w500,
),
),
Text(
data.mobileNumber ?? "-",
style: TextStyle(
color: ColorConstant.black3,
fontSize: SizeConstant.smallFont,
fontWeight: FontWeight.w500,
),
)
],
),
SizedBox(
height: SizeConstant.getHeightWithScreen(12),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
localization.translate('emailId'),
style: TextStyle(
color: ColorConstant.grey12,
fontSize: SizeConstant.smallFont,
fontWeight: FontWeight.w500,
),
),
Text(
data.emailId ?? "-",
style: TextStyle(
color: ColorConstant.black3,
fontSize: SizeConstant.smallFont,
fontWeight: FontWeight.w500,
),
)
],
),
SizedBox(
height: SizeConstant.getHeightWithScreen(19),
),
],
),
)
],
),
);
},
);
}