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.
80 lines
2.8 KiB
Dart
80 lines
2.8 KiB
Dart
import 'package:doctor_app_flutter/providers/schedule_provider.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_texts_widget.dart';
|
|
import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:provider/provider.dart';
|
|
|
|
import '../../config/size_config.dart';
|
|
import '../../widgets/shared/app_scaffold_widget.dart';
|
|
|
|
class MyScheduleScreen extends StatelessWidget {
|
|
ScheduleProvider scheduleProvider;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
scheduleProvider = Provider.of(context);
|
|
return Scaffold(
|
|
body: scheduleProvider.isLoading
|
|
? DrAppCircularProgressIndeicator()
|
|
: scheduleProvider.isError
|
|
? Center(
|
|
child: AppText(
|
|
scheduleProvider.error,
|
|
color: Theme.of(context).errorColor,
|
|
),
|
|
)
|
|
: scheduleProvider.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(),
|
|
// scheduleListByDate('Wednesday, 8 April '),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
|
|
Column scheduleListByDate() {
|
|
return Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: <Widget>[
|
|
SizedBox(
|
|
height: 10,
|
|
),
|
|
Container(
|
|
child: Column(
|
|
children: scheduleProvider.listDoctorWorkingHoursTable.map((item) {
|
|
return MyScheduleWidget(workingHoursTable: item,);
|
|
}).toList(),
|
|
),
|
|
),
|
|
],
|
|
);
|
|
}
|
|
|
|
}
|