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.
71 lines
2.4 KiB
Dart
71 lines
2.4 KiB
Dart
import 'package:doctor_app_flutter/core/viewModel/schedule_view_model.dart';
|
|
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
|
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
|
import 'package:doctor_app_flutter/widgets/doctor/my_schedule_widget.dart';
|
|
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
|
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
class MyScheduleScreen extends StatelessWidget {
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return BaseView<ScheduleViewModel>(
|
|
onModelReady: (model) => model.getDoctorSchedule(),
|
|
builder: (_, model, w) => AppScaffold(
|
|
baseViewModel: model,
|
|
isShowAppBar: false,
|
|
body: model.listDoctorWorkingHoursTable.length == 0
|
|
? Center(
|
|
child: AppText(
|
|
TranslationBase.of(context).errorNoSchedule,
|
|
color: Theme.of(context).errorColor,
|
|
),
|
|
)
|
|
: Container(
|
|
padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0),
|
|
child: ListView(
|
|
children: <Widget>[
|
|
Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: <Widget>[
|
|
Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: <Widget>[
|
|
SizedBox(
|
|
height: 20,
|
|
),
|
|
|
|
scheduleListByDate(model),
|
|
// scheduleListByDate('Wednesday, 8 April '),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
),
|
|
));
|
|
}
|
|
|
|
Column scheduleListByDate(ScheduleViewModel model ) {
|
|
return Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: <Widget>[
|
|
SizedBox(
|
|
height: 10,
|
|
),
|
|
Container(
|
|
child: Column(
|
|
children: model.listDoctorWorkingHoursTable.map((item) {
|
|
return MyScheduleWidget(workingHoursTable: item,);
|
|
}).toList(),
|
|
),
|
|
),
|
|
],
|
|
);
|
|
}
|
|
|
|
}
|