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.
92 lines
3.1 KiB
Dart
92 lines
3.1 KiB
Dart
import 'package:doctor_app_flutter/providers/schedule_provider.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,
|
|
appBarTitle: 'My Schdule',
|
|
body: scheduleProvider.isLoading
|
|
? Center(
|
|
child: CircularProgressIndicator(),
|
|
)
|
|
: scheduleProvider.isError
|
|
? Center(
|
|
child: Text(
|
|
scheduleProvider.error,
|
|
style: TextStyle(color: Theme.of(context).errorColor),
|
|
),
|
|
)
|
|
: scheduleProvider.listDoctorWorkingHoursTable.length == 0
|
|
? Center(
|
|
child: Text(
|
|
'You don\'t have any Schedule',
|
|
style: TextStyle(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,
|
|
),
|
|
Text('My Schedule',
|
|
style: textStyle(2.5, FontWeight.w700)),
|
|
scheduleListByDate('Today, 7 April '),
|
|
// scheduleListByDate('Wednesday, 8 April '),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
|
|
Column scheduleListByDate(date) {
|
|
return Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: <Widget>[
|
|
SizedBox(
|
|
height: 10,
|
|
),
|
|
// Text(date, style: textStyle(2.5)),
|
|
Container(
|
|
child: Column(
|
|
children: scheduleProvider.listDoctorWorkingHoursTable.map((item) {
|
|
return CardWithBgWidget(
|
|
line1Text: item.dayName,
|
|
line2Text:item.workingHours ,
|
|
heightPercentage: 0.18,
|
|
widthPercentage: 0.80,
|
|
);
|
|
}).toList(),
|
|
),
|
|
),
|
|
],
|
|
);
|
|
}
|
|
|
|
TextStyle textStyle(size, [FontWeight weight]) {
|
|
return TextStyle(
|
|
fontSize: size * SizeConfig.textMultiplier, fontWeight: weight);
|
|
}
|
|
}
|