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.
112 lines
4.3 KiB
Dart
112 lines
4.3 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_svg/flutter_svg.dart';
|
|
import 'package:provider/provider.dart';
|
|
import 'package:queuing_system/core/config/config.dart';
|
|
import 'package:queuing_system/home/app_provider.dart';
|
|
import 'package:queuing_system/utils/utils.dart';
|
|
import 'package:queuing_system/widget/data_display/app_texts_widget.dart';
|
|
|
|
class AppHeader extends StatelessWidget with PreferredSizeWidget {
|
|
const AppHeader({Key? key}) : super(key: key);
|
|
|
|
// Widget getWeatherWidget() {
|
|
// return Consumer(builder: (BuildContext context, AppProvider appProvider, Widget? child) {
|
|
// if (appProvider.currentWeathersWidgetModel.maxTemp == null || appProvider.currentWeathersWidgetModel.minTemp == null || appProvider.currentWeathersWidgetModel.iconPhrase == null) {
|
|
// return const SizedBox.shrink();
|
|
// }
|
|
// return Directionality(
|
|
// textDirection: appProvider.patientCallConfigurations.textDirection,
|
|
// child: Row(
|
|
// children: [
|
|
// SvgPicture.asset(
|
|
// appProvider.currentWeathersWidgetModel.weatherIconPath ?? AppGlobal.weatherIcon,
|
|
// height: SizeConfig.getHeightMultiplier() * 2.5,
|
|
// color: Colors.white,
|
|
// ),
|
|
// const SizedBox(width: 10),
|
|
// Padding(
|
|
// padding: const EdgeInsets.only(top: 15),
|
|
// child: AppText(
|
|
// "${appProvider.patientCallConfigurations.maxText}: ${appProvider.currentWeathersWidgetModel.maxTemp}°C , ${appProvider.patientCallConfigurations.minText}: ${appProvider.currentWeathersWidgetModel.minTemp}°C",
|
|
// color: Colors.white,
|
|
// fontSize: SizeConfig.getHeightMultiplier() * 1.3,
|
|
// ),
|
|
// ),
|
|
// ],
|
|
// ),
|
|
// );
|
|
// });
|
|
// }
|
|
//
|
|
// Widget getPrayerWidget() {
|
|
// return Consumer(builder: (BuildContext context, AppProvider appProvider, Widget? child) {
|
|
// if (appProvider.nextPrayerToShowWithTime.isEmpty) {
|
|
// return const SizedBox.shrink();
|
|
// }
|
|
// return Directionality(
|
|
// textDirection: appProvider.patientCallConfigurations.textDirection,
|
|
// // textDirection: appProvider.patientCallConfigurations.textDirection,
|
|
// child: Row(
|
|
// children: [
|
|
// SvgPicture.asset(
|
|
// AppGlobal.mosqueIcon,
|
|
// height: SizeConfig.getHeightMultiplier() * 2.5,
|
|
// color: Colors.white,
|
|
// ),
|
|
// const SizedBox(width: 10),
|
|
// Padding(
|
|
// padding: const EdgeInsets.only(top: 15),
|
|
// child: AppText(
|
|
// "${appProvider.patientCallConfigurations.nextPrayerText}: ${appProvider.nextPrayerToShowWithTime}",
|
|
// color: Colors.white,
|
|
// fontSize: SizeConfig.getHeightMultiplier() * 1.3,
|
|
// ),
|
|
// ),
|
|
// ],
|
|
// ),
|
|
// );
|
|
// });
|
|
// }
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
// return SizedBox();
|
|
return Consumer(
|
|
builder: (BuildContext context, AppProvider appProvider, Widget? child) {
|
|
return Container(
|
|
height: 100,
|
|
padding: const EdgeInsets.only(left: 20, right: 20),
|
|
decoration: BoxDecoration(color: AppGlobal.vitalSignColor),
|
|
child: Directionality(
|
|
textDirection: appProvider.patientCallConfigurations.textDirection,
|
|
child: Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
children: [
|
|
InkWell(
|
|
onTap: () async {
|
|
await appProvider.callPatientsAPI();
|
|
},
|
|
child: AppText(
|
|
appProvider.patientCallConfigurations.currentServeText,
|
|
color: Colors.white,
|
|
),
|
|
),
|
|
// getPrayerWidget(),
|
|
// getWeatherWidget(),
|
|
SvgPicture.asset(
|
|
"assets/images/hmglogo.svg",
|
|
height: Utils.getHeight() * 0.5,
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
},
|
|
);
|
|
}
|
|
|
|
@override
|
|
Size get preferredSize => Size(double.maxFinite, Utils.getHeight());
|
|
}
|