76 lines
2.7 KiB
Dart
76 lines
2.7 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:queue_mgr/backend/DataManager.dart';
|
|
|
|
class ServicePage extends StatefulWidget {
|
|
ServicePage({super.key,required this.serviceId});
|
|
String serviceId;
|
|
@override
|
|
State<ServicePage> createState() => _ServicePageState();
|
|
}
|
|
|
|
class _ServicePageState extends State<ServicePage> {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
Map<String, dynamic> service = DataManager.instance().GetServiceById(widget.serviceId.toString());
|
|
|
|
return Scaffold(
|
|
appBar: AppBar(title: Text(service['name']),),
|
|
body: Padding(
|
|
padding: const EdgeInsets.all(12.0),
|
|
child: Column(
|
|
children: [
|
|
GridView.count(shrinkWrap: true,crossAxisCount: 2,children: [
|
|
Card(child:
|
|
Column(
|
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
|
children: [
|
|
Row(mainAxisAlignment: MainAxisAlignment.center,children: [Icon(Icons.play_arrow),Text(" Starting Time")],),
|
|
Column(
|
|
children: [
|
|
Text(dateFormat.format(DateTime.parse(service['start_time']))),
|
|
Text(timeFormat.format(DateTime.parse(service['start_time'])),style: TextStyle(fontSize: 20)),
|
|
],
|
|
),
|
|
Container(height: 20,)
|
|
],
|
|
),),
|
|
Card(child:
|
|
Column(
|
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
|
children: [
|
|
Row(mainAxisAlignment: MainAxisAlignment.center,children: [Icon(Icons.stop),Text(" Ending Time")],),
|
|
Column(
|
|
children: [
|
|
Text(dateFormat.format(DateTime.parse(service['end_time']))),
|
|
Text(timeFormat.format(DateTime.parse(service['end_time'])),style: TextStyle(fontSize: 20)),
|
|
],
|
|
),
|
|
Container(height: 20,)
|
|
],
|
|
),),
|
|
|
|
],),
|
|
Card(
|
|
child: Padding(
|
|
padding: const EdgeInsets.all(12.0),
|
|
child: Column(
|
|
children: [
|
|
Row(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: [
|
|
Icon(Icons.people_alt_rounded),
|
|
Text(" Queue Length"),
|
|
],
|
|
),
|
|
Text(service['members'].toString().split(',').length.toString(),style: TextStyle(fontSize: 25),)
|
|
],
|
|
),
|
|
),
|
|
)
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|