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/screens/doctor/my_schedule_screen.dart

91 lines
3.3 KiB
Dart

import 'package:doctor_app_flutter/providers/schedule_provider.dart';
import 'package:doctor_app_flutter/util/helpers.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/card_with_bgNew_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';
import '../../widgets/shared/card_with_bg_widget.dart';
class MyScheduleScreen extends StatelessWidget {
ScheduleProvider scheduleProvider;
@override
Widget build(BuildContext context) {
scheduleProvider = Provider.of(context);
return AppScaffold(
// pageOnly: false,
showBottomBar: false,
showAppDrawer: false,
appBarTitle: TranslationBase.of(context).mySchedule,
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(),
),
),
],
);
}
TextStyle textStyle(size, [FontWeight weight]) {
return TextStyle(
fontSize: size * SizeConfig.textMultiplier, fontWeight: weight);
}
}