completed new design
parent
478d25d9b4
commit
7f877fae73
@ -1,116 +1,116 @@
|
|||||||
import 'package:blinking_text/blinking_text.dart';
|
// import 'package:blinking_text/blinking_text.dart';
|
||||||
import 'package:flutter/material.dart';
|
// import 'package:flutter/material.dart';
|
||||||
import 'package:hmg_qline/constants/app_constants.dart';
|
// import 'package:hmg_qline/constants/app_constants.dart';
|
||||||
import 'package:hmg_qline/models/global_config_model.dart';
|
// import 'package:hmg_qline/models/global_config_model.dart';
|
||||||
import 'package:hmg_qline/utilities/enums.dart';
|
// import 'package:hmg_qline/utilities/enums.dart';
|
||||||
import 'package:hmg_qline/utilities/extensions.dart';
|
// import 'package:hmg_qline/utilities/extensions.dart';
|
||||||
import 'package:hmg_qline/views/common_widgets/app_texts_widget.dart';
|
// import 'package:hmg_qline/views/common_widgets/app_texts_widget.dart';
|
||||||
import 'package:hmg_qline/views/view_helpers/size_config.dart';
|
// import 'package:hmg_qline/views/view_helpers/size_config.dart';
|
||||||
|
//
|
||||||
class TicketItem extends StatelessWidget {
|
// class TicketItem extends StatelessWidget {
|
||||||
final String ticketNo;
|
// final String ticketNo;
|
||||||
final String roomNo;
|
// final String roomNo;
|
||||||
final bool blink;
|
// final bool blink;
|
||||||
final double scale;
|
// final double scale;
|
||||||
final bool isClinicAdded;
|
// final bool isClinicAdded;
|
||||||
final TextDirection textDirection;
|
// final TextDirection textDirection;
|
||||||
final String roomText;
|
// final String roomText;
|
||||||
final GlobalConfigurationsModel globalConfigurationsModel;
|
// final GlobalConfigurationsModel globalConfigurationsModel;
|
||||||
final CallTypeEnum callTypeEnum;
|
// final CallTypeEnum callTypeEnum;
|
||||||
final ScreenTypeEnum screenTypeEnum;
|
// final ScreenTypeEnum screenTypeEnum;
|
||||||
final LanguageEnum langTypeEnum;
|
// final LanguageEnum langTypeEnum;
|
||||||
|
//
|
||||||
const TicketItem({
|
// const TicketItem({
|
||||||
super.key,
|
// super.key,
|
||||||
required this.isClinicAdded,
|
// required this.isClinicAdded,
|
||||||
required this.ticketNo,
|
// required this.ticketNo,
|
||||||
required this.roomNo,
|
// required this.roomNo,
|
||||||
required this.scale,
|
// required this.scale,
|
||||||
required this.textDirection,
|
// required this.textDirection,
|
||||||
required this.roomText,
|
// required this.roomText,
|
||||||
required this.globalConfigurationsModel,
|
// required this.globalConfigurationsModel,
|
||||||
required this.callTypeEnum,
|
// required this.callTypeEnum,
|
||||||
required this.screenTypeEnum,
|
// required this.screenTypeEnum,
|
||||||
required this.langTypeEnum,
|
// required this.langTypeEnum,
|
||||||
this.blink = false,
|
// this.blink = false,
|
||||||
});
|
// });
|
||||||
|
//
|
||||||
String getFormattedTicket(String ticketNo, bool isClinicAdded) {
|
// String getFormattedTicket(String ticketNo, bool isClinicAdded) {
|
||||||
if (isClinicAdded) {
|
// if (isClinicAdded) {
|
||||||
var formattedString = ticketNo.split(" ");
|
// var formattedString = ticketNo.split(" ");
|
||||||
if (formattedString.length > 1) {
|
// if (formattedString.length > 1) {
|
||||||
return "${formattedString[0]} ${formattedString[1]}";
|
// return "${formattedString[0]} ${formattedString[1]}";
|
||||||
} else {
|
// } else {
|
||||||
return ticketNo;
|
// return ticketNo;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
return ticketNo;
|
// return ticketNo;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@override
|
// @override
|
||||||
Widget build(BuildContext context) {
|
// Widget build(BuildContext context) {
|
||||||
return Transform.scale(
|
// return Transform.scale(
|
||||||
scale: scale,
|
// scale: scale,
|
||||||
child: Column(
|
// child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
// crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
// children: [
|
||||||
BlinkText(getFormattedTicket(ticketNo, isClinicAdded),
|
// BlinkText(getFormattedTicket(ticketNo, isClinicAdded),
|
||||||
style: TextStyle(
|
// style: TextStyle(
|
||||||
fontSize: SizeConfig.getWidthMultiplier() * 10,
|
// fontSize: SizeConfig.getWidthMultiplier() * 10,
|
||||||
letterSpacing: -1,
|
// letterSpacing: -1,
|
||||||
height: 0.5,
|
// height: 0.5,
|
||||||
fontWeight: FontWeight.bold,
|
// fontWeight: FontWeight.bold,
|
||||||
fontFamily: langTypeEnum == LanguageEnum.arabic ? AppStrings.fontNameCairo : AppStrings.fontNamePoppins,
|
// fontFamily: langTypeEnum == LanguageEnum.arabic ? AppStrings.fontNameCairo : AppStrings.fontNamePoppins,
|
||||||
),
|
// ),
|
||||||
beginColor: Colors.black,
|
// beginColor: Colors.black,
|
||||||
endColor: blink ? Colors.black.withOpacity(0.1) : Colors.black,
|
// endColor: blink ? Colors.black.withOpacity(0.1) : Colors.black,
|
||||||
times: 0,
|
// times: 0,
|
||||||
duration: const Duration(seconds: 1)),
|
// duration: const Duration(seconds: 1)),
|
||||||
const SizedBox(height: 30),
|
// const SizedBox(height: 30),
|
||||||
screenTypeEnum == ScreenTypeEnum.roomLevelScreen
|
// screenTypeEnum == ScreenTypeEnum.roomLevelScreen
|
||||||
? const SizedBox()
|
// ? const SizedBox()
|
||||||
: Directionality(
|
// : Directionality(
|
||||||
textDirection: textDirection,
|
// textDirection: textDirection,
|
||||||
child: Row(
|
// child: Row(
|
||||||
crossAxisAlignment: CrossAxisAlignment.end,
|
// crossAxisAlignment: CrossAxisAlignment.end,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
// mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
// children: [
|
||||||
Padding(
|
// Padding(
|
||||||
padding: const EdgeInsets.only(bottom: 8.0),
|
// padding: const EdgeInsets.only(bottom: 8.0),
|
||||||
child: SizedBox(
|
// child: SizedBox(
|
||||||
height: SizeConfig.getWidthMultiplier() * 3,
|
// height: SizeConfig.getWidthMultiplier() * 3,
|
||||||
child: callTypeEnum.getIconByCallType(SizeConfig.getHeightMultiplier() * 0.3),
|
// child: callTypeEnum.getIconByCallType(SizeConfig.getHeightMultiplier() * 0.3),
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
const SizedBox(width: 13),
|
// const SizedBox(width: 13),
|
||||||
AppText(
|
// AppText(
|
||||||
callTypeEnum.getMessageByCallTypeForEnglish(globalConfigurationsModel, isListView: false),
|
// callTypeEnum.getMessageByCallTypeForEnglish(globalConfigurationsModel, isListView: false),
|
||||||
color: callTypeEnum.getColorByCallType(),
|
// color: callTypeEnum.getColorByCallType(),
|
||||||
fontSize: SizeConfig.getWidthMultiplier() * 3.8,
|
// fontSize: SizeConfig.getWidthMultiplier() * 3.8,
|
||||||
fontWeight: FontWeight.w600,
|
// fontWeight: FontWeight.w600,
|
||||||
fontHeight: 1,
|
// fontHeight: 1,
|
||||||
fontFamily: langTypeEnum == LanguageEnum.arabic ? AppStrings.fontNameCairo : AppStrings.fontNamePoppins,
|
// fontFamily: langTypeEnum == LanguageEnum.arabic ? AppStrings.fontNameCairo : AppStrings.fontNamePoppins,
|
||||||
),
|
// ),
|
||||||
Container(
|
// Container(
|
||||||
color: Colors.grey.withOpacity(0.5),
|
// color: Colors.grey.withOpacity(0.5),
|
||||||
width: 5,
|
// width: 5,
|
||||||
height: SizeConfig.getHeightMultiplier() * 0.3,
|
// height: SizeConfig.getHeightMultiplier() * 0.3,
|
||||||
margin: const EdgeInsets.symmetric(horizontal: 15),
|
// margin: const EdgeInsets.symmetric(horizontal: 15),
|
||||||
),
|
// ),
|
||||||
AppText(
|
// AppText(
|
||||||
textDirection == TextDirection.ltr ? "$roomText: $roomNo" : " $roomNo : $roomText",
|
// textDirection == TextDirection.ltr ? "$roomText: $roomNo" : " $roomNo : $roomText",
|
||||||
color: callTypeEnum.getColorByCallType(),
|
// color: callTypeEnum.getColorByCallType(),
|
||||||
letterSpacing: -1,
|
// letterSpacing: -1,
|
||||||
fontSize: SizeConfig.getWidthMultiplier() * 3.8,
|
// fontSize: SizeConfig.getWidthMultiplier() * 3.8,
|
||||||
fontWeight: FontWeight.w600,
|
// fontWeight: FontWeight.w600,
|
||||||
fontHeight: 1,
|
// fontHeight: 1,
|
||||||
fontFamily: langTypeEnum == LanguageEnum.arabic ? AppStrings.fontNameCairo : AppStrings.fontNamePoppins,
|
// fontFamily: langTypeEnum == LanguageEnum.arabic ? AppStrings.fontNameCairo : AppStrings.fontNamePoppins,
|
||||||
),
|
// ),
|
||||||
],
|
// ],
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
],
|
// ],
|
||||||
),
|
// ),
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|||||||
Loading…
Reference in New Issue