taafee-mobile/lib/features/card/presentation_layer/widgets/appointment_details.dart
2023-10-22 15:42:12 +03:00

88 lines
2.8 KiB
Dart

import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:intl/intl.dart';
import '../../../../common/const/const.dart';
import '../../../../common/widgets/text.dart';
import '../../../home/business_logic_layer/home_controller.dart';
class AppointmentDetails extends StatelessWidget {
AppointmentDetails({
super.key,
required this.dateTime,
});
final DateTime dateTime;
final HomeController homeController = Get.find<HomeController>();
@override
Widget build(BuildContext context) {
return SizedBox(
width: 320,
height: 240,
child: Column(
children: [
const SizedBox(
height: 16,
),
RegularTextWidget(
'you_have_an_appointment_on'.tr,
fontSize: 15,
),
const SizedBox(
height: 20,
),
Container(
padding: EdgeInsets.all(8),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),
color: AppColors.secondaryColor.withOpacity(0.7),
),
child: Column(
children: [
RegularTextWidget(
DateFormat.EEEE().format(dateTime).tr,
fontSize: 15,
color: Colors.white,
),
Row(
children: [
const Icon(
Icons.calendar_month,
color: Colors.white,
),
RegularTextWidget(
' ${dateTime.day} / ${dateTime.month}',
fontSize: 15,
color: Colors.white,
),
],
),
Row(
children: [
const Icon(
Icons.schedule,
color: Colors.white,
),
if (!homeController.isArabic.value)
RegularTextWidget(
' ${dateTime.hour % 12} : ${dateTime.minute >= 10 ? dateTime.minute : '0${dateTime.minute}'} ${(dateTime.hour <= 12) ? 'am'.tr : 'pm'.tr}',
color: Colors.white,
fontSize: 15,
),
if (homeController.isArabic.value)
RegularTextWidget(
' ${dateTime.minute >= 10 ? dateTime.minute : '0${dateTime.minute}'} : ${dateTime.hour % 12} ${(dateTime.hour <= 12) ? 'am'.tr : 'pm'.tr}',
color: Colors.white,
fontSize: 15,
),
],
),
],
),
).paddingSymmetric(horizontal: 16)
],
),
);
}
}