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.
RSGDoctorApp/lib/widgets/doctor/my_schedule_widget.dart

148 lines
6.3 KiB
Dart

import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/core/model/doctor/list_doctor_working_hours_table_model.dart';
5 years ago
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
5 years ago
import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
class MyScheduleWidget extends StatelessWidget {
final ListDoctorWorkingHoursTable workingHoursTable;
MyScheduleWidget({Key key, this.workingHoursTable});
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
List<WorkingHours> workingHours = Helpers.getWorkingHours(
workingHoursTable.workingHours,
);
return Container(
color: HexColor("#EFEFEF"),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 10,
),
Padding(
padding: const EdgeInsets.only(left: 21),
child: AppText(
projectViewModel.isArabic
? AppDateUtils.getWeekDayArabic(
workingHoursTable.date.weekday)
: AppDateUtils.getWeekDay(workingHoursTable.date.weekday),
fontSize: MediaQuery.of(context).size.width*0.032,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
letterSpacing: -0.52,
color: AppGlobal.scheduleTextColor,
),
),
Padding(
padding: const EdgeInsets.only(left: 19),
child: AppText(
' ${workingHoursTable.date.day} ${(AppDateUtils.getMonth(workingHoursTable.date.month).toString().substring(0, 3))}',
fontSize: MediaQuery.of(context).size.width*0.051,
fontWeight: FontWeight.w700,
fontFamily: 'Poppins',
letterSpacing: -0.72,
color: AppGlobal.scheduleTextColor,
),
),
],
),
),
Container(
width: MediaQuery.of(context).size.width * 0.70,
// height: MediaQuery.of(context).size.height * 0.16,
child: CardWithBgWidget(
padding: 12,
marginLeft: 8,
marginSymmetric: 7,
hasBorder: false,
bgColor: AppDateUtils.isToday(workingHoursTable.date)
? AppGlobal.appGreenColor
: Colors.transparent,
widget: Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
if (AppDateUtils.isToday(workingHoursTable.date))
AppText(
"Today",
fontSize: 1.5 * SizeConfig.textMultiplier,
fontFamily: 'Poppins',
color: AppGlobal.appGreenColor,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: workingHours.map((work) {
return Container(
margin: EdgeInsets.only(
bottom: workingHours.length > 1 ? 15 : 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
SizedBox(
height: 5,
),
if (workingHoursTable.clinicName != null)
Container(
width: MediaQuery.of(context).size.width * 0.65,
child: AppText(
Helpers
.convertToTitleCase(
workingHoursTable.clinicName ?? ""),
fontSize: MediaQuery.of(context).size.width*0.04,
fontWeight: FontWeight.w700,
letterSpacing: -0.64,
color: AppGlobal.scheduleTextColor,
),
),
// AppText(
Container(
child: AppText(
'${work.from} - ${work.to}',
fontSize: MediaQuery.of(context).size.width*0.03,
fontWeight: FontWeight.w300,
letterSpacing: -0.4,
),
5 years ago
),
SizedBox(
height: 12,
),
if (workingHoursTable.projectName != null)
AppText(
workingHoursTable.projectName ?? "",
fontSize: MediaQuery.of(context).size.width*0.04,
fontWeight: FontWeight.w700,
letterSpacing: -0.64,
color: AppGlobal.scheduleTextColor,
),
],
),
);
}).toList(),
),
],
),
5 years ago
),
),
5 years ago
),
],
),
);
}
}