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.
mohemm-flutter-app/lib/home/priority_calls.dart

102 lines
3.3 KiB
Dart

import 'package:blinking_text/blinking_text.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:queuing_system/core/config/config.dart';
import 'package:queuing_system/core/config/size_config.dart';
import 'package:queuing_system/core/response_model/patient_call.dart';
import 'package:queuing_system/home/que_item/que_item.dart';
import 'package:queuing_system/utils/call_type.dart';
import 'package:queuing_system/widget/data_display/app_texts_widget.dart';
class PriorityTickets extends StatelessWidget {
List<Tickets> tickets;
PriorityTickets(this.tickets, {Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
final firstTicket = tickets[0];
final otherTickets = tickets.sublist(1,tickets.length);
return Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
vTicketItem(ticketNo: "${firstTicket.callNo ?? ''}", callType: firstTicket.getCallType(), scale: 1.2, blink: true),
const SizedBox(height: 100),
if(tickets.length > 1)
...[
SizedBox(height: SizeConfig.getHeightMultiplier()*1.5),
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: otherTickets.map((ticket) => vTicketItem(ticketNo: "${ticket.callNo ?? ''}", callType: ticket.getCallType(), scale: 0.8)).toList(),
)
]
],
);
}
}
class vTicketItem extends StatelessWidget{
final String ticketNo;
final CallType callType;
final bool blink;
final double scale;
vTicketItem({@required this.ticketNo, @required this.callType, this.scale, this.blink = false});
@override
Widget build(BuildContext context) {
return Transform.scale(
scale: scale,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
BlinkText(
ticketNo,
style: TextStyle(
fontSize: SizeConfig.getWidthMultiplier() * 16,
letterSpacing: -9.32,
height: 0.5,
fontWeight: FontWeight.bold
),
beginColor: Colors.black,
endColor: blink ? Colors.black.withOpacity(0.1) : Colors.black,
// endColor: blink ? AppGlobal.appRedColor : Colors.black,
times: 0,
duration: const Duration(seconds: 1)
),
// AppText(
// ticketNo,
// letterSpacing: -9.32,
// fontSize: SizeConfig.getWidthMultiplier() * 16,
// fontWeight: FontWeight.bold,
// fontHeight: 0.7,
// ),
Row(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.center,
children: [
callType.icon(SizeConfig.getHeightMultiplier()*2.5),
const SizedBox(width: 10),
AppText(
callType.message('en'),
color: callType.color(),
letterSpacing: -1.5,
fontSize: SizeConfig.getWidthMultiplier() * 3.3,
fontWeight: FontWeight.w600,
fontHeight: 0.5,
),
],
),
],
),
);
}
}