draft booking scheduler page

This commit is contained in:
mr
2024-11-13 08:12:37 +01:00
parent 1ca77b6611
commit 062042b590
15 changed files with 288 additions and 72 deletions

View File

@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_box_transform/flutter_box_transform.dart';
import 'package:oc_front/core/sections/header/header.dart';
import 'package:oc_front/main.dart';
import 'package:oc_front/models/workflow.dart';
import 'package:oc_front/widgets/sheduler_items/schedule.dart';
@@ -17,8 +18,8 @@ class SchedulerItemWidget extends StatefulWidget {
@override SchedulerItemWidgetState createState() => SchedulerItemWidgetState();
}
class SchedulerItemWidgetState extends State<SchedulerItemWidget> {
List<Color> colors = [Colors.blue, Colors.orange, Colors.red, Colors.green];
List<String> titles = ["SCHEDULED", "RUNNING", "FAILURE", "SUCCESS"];
List<Color> colors = [Colors.blue, Colors.orange, redColor, Colors.green, redColor];
List<String> titles = ["SCHEDULED", "RUNNING", "FAILURE", "SUCCESS", "FORGOTTEN"];
@override Widget build(BuildContext context) {
List<Widget> children = [];
@@ -42,8 +43,7 @@ class SchedulerItemWidgetState extends State<SchedulerItemWidget> {
padding: const EdgeInsets.symmetric(vertical: 20, horizontal: 50),
decoration: BoxDecoration(
border: selectedReal == ev.executionData ?
Border.all(color: const Color.fromRGBO(38, 166, 154, 1), width: 2)
: Border(top: BorderSide(color: Colors.grey.shade300)),
Border.all(color: lightColor, width: 2) : Border(top: BorderSide(color: midColor)),
),
child: Row(children: [
Container( width: 110,
@@ -64,7 +64,7 @@ class SchedulerItemWidgetState extends State<SchedulerItemWidget> {
)),
SizedBox( width: (widget.width - 340) / 2,
child: Padding(
padding: const EdgeInsets.only(left: 20),
padding: const EdgeInsets.only(left: 17),
child: Container( padding: const EdgeInsets.symmetric(horizontal: 20),
child: Text(d3 != null ? "killed at ${d3.day}/${d3.month}/${d3.year} ${d3.hour}:${d3.minute}:${d3.second}"
: "infinite run till process end", overflow: TextOverflow.ellipsis,
@@ -72,7 +72,7 @@ class SchedulerItemWidgetState extends State<SchedulerItemWidget> {
)),
SizedBox(
child: Padding(
padding: const EdgeInsets.only(left: 20),
padding: const EdgeInsets.only(left: 17),
child: Text("${d2.hour > 9 ? d2.hour : "0${d2.hour}"}:${d2.minute > 9 ? d2.minute : "0${d2.minute}"}:${d2.second > 9 ? d2.second : "0${d2.second}"}", overflow: TextOverflow.ellipsis,
style: const TextStyle(fontSize: 25,
color: Colors.grey, fontWeight: FontWeight.w500))))
@@ -81,12 +81,12 @@ class SchedulerItemWidgetState extends State<SchedulerItemWidget> {
}
var date = DateTime.parse(element);
children.add(Container(
decoration: const BoxDecoration(
border: Border(bottom: BorderSide(color: Colors.black)),
decoration: BoxDecoration(
border: Border(bottom: BorderSide(color: Colors.grey.shade300)),
),
child: Column( children: [ExpansionTile(
child: Column( children: [ ExpansionTile(
enabled: widget.enabled,
shape: const ContinuousRectangleBorder(),
shape: const ContinuousRectangleBorder(side : BorderSide(color: Colors.grey)),
iconColor: Colors.grey,
initiallyExpanded: true,
title: SizedBox(
@@ -110,11 +110,15 @@ class SchedulerItemWidgetState extends State<SchedulerItemWidget> {
}
});
return Container(
decoration: BoxDecoration(
color: children.isNotEmpty ? Colors.transparent : midColor,
border: Border( right: BorderSide( color: children.isNotEmpty ? Colors.transparent : Colors.white) ),
),
alignment: children.isNotEmpty ? Alignment.topLeft : Alignment.center,
color: children.isNotEmpty ? Colors.transparent : Colors.white,
width: children.isNotEmpty ? MediaQuery.of(context).size.width : null,
height: MediaQuery.of(context).size.height - HeaderConstants.height - 50,
child: children.isNotEmpty ? SingleChildScrollView( child: Column( children: children)) : const Text("NO DATA FOUND", style: TextStyle(color: Colors.grey, fontSize: 30))
width: children.isNotEmpty ? getMainWidth(context) : null,
height: getMainHeight(context) - 50,
child: children.isNotEmpty ? SingleChildScrollView( child: Column( children: children)) : const Text(
"NO DATA FOUND", style: TextStyle(color: Colors.grey, fontSize: 30))
);
}
}