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

101 lines
3.5 KiB
Dart

import 'package:doctor_app_flutter/config/size_config.dart';
6 years ago
import 'package:doctor_app_flutter/models/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';
class MyScheduleWidget extends StatelessWidget {
final ListDoctorWorkingHoursTable workingHoursTable;
MyScheduleWidget({Key key, this.workingHoursTable});
@override
Widget build(BuildContext context) {
List<WorkingHours> workingHours = Helpers.getWorkingHours(
workingHoursTable.workingHours,
);
5 years ago
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 10,
),
AppText(
workingHoursTable.dayName,
5 years ago
fontSize: 18,
fontFamily: 'Poppins',
// fontSize: 18
),
AppText(
' ${workingHoursTable.date.day} ${(DateUtils.getMonth(workingHoursTable.date.month).toString().substring(0, 3))}',
5 years ago
fontSize: 18,
fontWeight: FontWeight.w700,
fontFamily: 'Poppins',
// fontSize: 18
),
],
),
5 years ago
),
Container(
width: MediaQuery.of(context).size.width * 0.55,
child: CardWithBgWidget(
bgColor: DateUtils.isToday(workingHoursTable.date)
? Colors.green[500]
: Colors.transparent,
5 years ago
// hasBorder: false,
5 years ago
widget: Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
if (DateUtils.isToday(workingHoursTable.date))
AppText(
"Today",
fontSize: 2.5 * SizeConfig.textMultiplier,
fontFamily: 'Poppins',
color: Colors.green[500],
// fontSize: 18
),
SizedBox(
height: 10,
),
5 years ago
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: workingHours.map((work) {
return Container(
child: Column(
children: <Widget>[
SizedBox(
height: 5,
),
Container(
width: MediaQuery.of(context).size.width*0.55,
child: AppText(
'${work.from} - ${work.to}',
fontSize: 15,
fontWeight: FontWeight.w300,
),
5 years ago
)
],
),
);
}).toList(),
),
],
),
),
5 years ago
),
),
5 years ago
],
);
}
}