|
|
|
@ -1,9 +1,12 @@
|
|
|
|
|
|
|
|
import 'dart:developer';
|
|
|
|
|
|
|
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter_svg/flutter_svg.dart';
|
|
|
|
import 'package:flutter_svg/flutter_svg.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
import 'package:queuing_system/core/base/app_scaffold_widget.dart';
|
|
|
|
import 'package:queuing_system/core/base/app_scaffold_widget.dart';
|
|
|
|
import 'package:queuing_system/core/config/config.dart';
|
|
|
|
import 'package:queuing_system/core/config/config.dart';
|
|
|
|
import 'package:queuing_system/core/config/size_config.dart';
|
|
|
|
import 'package:queuing_system/core/config/size_config.dart';
|
|
|
|
|
|
|
|
import 'package:queuing_system/core/response_models/call_config_model.dart';
|
|
|
|
import 'package:queuing_system/footer/app_footer.dart';
|
|
|
|
import 'package:queuing_system/footer/app_footer.dart';
|
|
|
|
import 'package:queuing_system/header/app_header.dart';
|
|
|
|
import 'package:queuing_system/header/app_header.dart';
|
|
|
|
import 'package:queuing_system/home/app_provider.dart';
|
|
|
|
import 'package:queuing_system/home/app_provider.dart';
|
|
|
|
@ -19,10 +22,9 @@ class MyHomePage extends StatelessWidget {
|
|
|
|
return const SizedBox.shrink();
|
|
|
|
return const SizedBox.shrink();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return Container(
|
|
|
|
return Container(
|
|
|
|
constraints: BoxConstraints(
|
|
|
|
height: (appProvider.currentScreenRotation == ScreenOrientationEnum.portraitUp || appProvider.currentScreenRotation == ScreenOrientationEnum.portraitDown)
|
|
|
|
minWidth: SizeConfig.getWidthMultiplier() * 30,
|
|
|
|
? SizeConfig.getHeightMultiplier() * 8
|
|
|
|
minHeight: SizeConfig.getHeightMultiplier() * 5.5,
|
|
|
|
: SizeConfig.getHeightMultiplier() * 5,
|
|
|
|
),
|
|
|
|
|
|
|
|
padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 10),
|
|
|
|
padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 10),
|
|
|
|
decoration: AppGlobal.configWidgetDecoration,
|
|
|
|
decoration: AppGlobal.configWidgetDecoration,
|
|
|
|
child: Directionality(
|
|
|
|
child: Directionality(
|
|
|
|
@ -64,10 +66,9 @@ class MyHomePage extends StatelessWidget {
|
|
|
|
return const SizedBox.shrink();
|
|
|
|
return const SizedBox.shrink();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return Container(
|
|
|
|
return Container(
|
|
|
|
constraints: BoxConstraints(
|
|
|
|
height: (appProvider.currentScreenRotation == ScreenOrientationEnum.portraitUp || appProvider.currentScreenRotation == ScreenOrientationEnum.portraitDown)
|
|
|
|
minWidth: SizeConfig.getWidthMultiplier() * 25,
|
|
|
|
? SizeConfig.getHeightMultiplier() * 8
|
|
|
|
minHeight: SizeConfig.getHeightMultiplier() * 5,
|
|
|
|
: SizeConfig.getHeightMultiplier() * 5,
|
|
|
|
),
|
|
|
|
|
|
|
|
padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 10),
|
|
|
|
padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 10),
|
|
|
|
decoration: AppGlobal.configWidgetDecoration,
|
|
|
|
decoration: AppGlobal.configWidgetDecoration,
|
|
|
|
child: Directionality(
|
|
|
|
child: Directionality(
|
|
|
|
@ -102,7 +103,7 @@ class MyHomePage extends StatelessWidget {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
getBody(AppProvider appProvider) {
|
|
|
|
getBody(AppProvider appProvider, context) {
|
|
|
|
return Column(
|
|
|
|
return Column(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
const SizedBox(height: 12),
|
|
|
|
const SizedBox(height: 12),
|
|
|
|
@ -121,32 +122,52 @@ class MyHomePage extends StatelessWidget {
|
|
|
|
const SizedBox(height: 20),
|
|
|
|
const SizedBox(height: 20),
|
|
|
|
Expanded(
|
|
|
|
Expanded(
|
|
|
|
flex: 9,
|
|
|
|
flex: 9,
|
|
|
|
child: dataContent(appProvider: appProvider),
|
|
|
|
child: dataContent(appProvider: appProvider, context: context),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int getTurnsByOrientation(ScreenOrientationEnum screenOrientationEnum) {
|
|
|
|
|
|
|
|
switch (screenOrientationEnum) {
|
|
|
|
|
|
|
|
case ScreenOrientationEnum.portraitUp:
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
case ScreenOrientationEnum.portraitDown:
|
|
|
|
|
|
|
|
return 2;
|
|
|
|
|
|
|
|
case ScreenOrientationEnum.landscapeRight:
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
case ScreenOrientationEnum.landscapeLeft:
|
|
|
|
|
|
|
|
return 3;
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
final appProvider = context.watch<AppProvider>();
|
|
|
|
final appProvider = context.watch<AppProvider>();
|
|
|
|
return AppScaffold(
|
|
|
|
log(appProvider.currentScreenRotation.toString());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return RotatedBox(
|
|
|
|
|
|
|
|
// quarterTurns: 3,
|
|
|
|
|
|
|
|
quarterTurns: getTurnsByOrientation(appProvider.currentScreenRotation),
|
|
|
|
|
|
|
|
child: AppScaffold(
|
|
|
|
appProvider: appProvider,
|
|
|
|
appProvider: appProvider,
|
|
|
|
appBar: const AppHeader(),
|
|
|
|
appBar: const AppHeader(),
|
|
|
|
body: getBody(appProvider),
|
|
|
|
body: getBody(appProvider, context),
|
|
|
|
bottomNavigationBar: const AppFooter(),
|
|
|
|
bottomNavigationBar: const AppFooter(),
|
|
|
|
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Widget dataContent({required AppProvider appProvider}) {
|
|
|
|
Widget dataContent({required AppProvider appProvider, required BuildContext context}) {
|
|
|
|
// appProvider.testCalling();
|
|
|
|
// appProvider.testCalling();
|
|
|
|
|
|
|
|
|
|
|
|
if (appProvider.patientTickets.isEmpty) {
|
|
|
|
if (appProvider.patientTickets.isEmpty) {
|
|
|
|
// No Patient in Queue
|
|
|
|
// No Patient in Queue
|
|
|
|
return noPatientInQueue();
|
|
|
|
return noPatientInQueue(screenOrientationEnum: appProvider.currentScreenRotation);
|
|
|
|
} else if (appProvider.patientTickets.length > 3) {
|
|
|
|
} else if (appProvider.patientTickets.length > 3) {
|
|
|
|
// Return Content With Side List
|
|
|
|
// Return Content With Side List
|
|
|
|
return priorityTicketsWithSideList(tickets: appProvider.patientTickets, callConfig: appProvider.patientCallConfigurations);
|
|
|
|
return priorityTicketsWithSideList(tickets: appProvider.patientTickets, callConfig: appProvider.patientCallConfigurations, context: context);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
// Return Content In Center Aligned
|
|
|
|
// Return Content In Center Aligned
|
|
|
|
return PriorityTickets(tickets: appProvider.patientTickets, callConfig: appProvider.patientCallConfigurations);
|
|
|
|
return PriorityTickets(tickets: appProvider.patientTickets, callConfig: appProvider.patientCallConfigurations);
|
|
|
|
|