This commit is contained in:
mr
2024-11-08 13:59:22 +01:00
parent 685badc59a
commit 1ca77b6611
69 changed files with 1601 additions and 1337 deletions

View File

@@ -1,5 +1,6 @@
import 'package:flutter/material.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';
import 'package:table_calendar/table_calendar.dart';
@@ -23,7 +24,7 @@ class SchedulerCalendarWidget extends StatefulWidget {
@override SchedulerCalendarWidgetState createState() => SchedulerCalendarWidgetState();
}
class SchedulerCalendarWidgetState extends State<SchedulerCalendarWidget> {
List<Color> colors = [Colors.blue, Colors.orange, Colors.red, Colors.green];
List<Color> colors = [Colors.blue, Colors.orange, redColor, Colors.green];
List<String> titles = ["SCHEDULED", "RUNNING", "FAILURE", "SUCCESS"];
bool isEvent(Map<String, List<WorkflowExecution>> data, DateTime day) {
if (data[day.toIso8601String()] == null || data[day.toIso8601String()]!.isEmpty) { return false; }
@@ -34,7 +35,7 @@ class SchedulerCalendarWidgetState extends State<SchedulerCalendarWidget> {
widget.focusedDay.isAfter(widget.end) ? widget.end : widget.focusedDay );
return Container(
padding: const EdgeInsets.only(left: 20, right: 20, bottom: 20),
height: MediaQuery.of(context).size.height - HeaderConstants.height - 50,
height: getMainHeight(context) - 50,
child: TableCalendar<Event>(
firstDay: widget.start,
lastDay: widget.end,
@@ -61,7 +62,7 @@ class SchedulerCalendarWidgetState extends State<SchedulerCalendarWidget> {
padding: const EdgeInsets.symmetric(horizontal: 10.0, vertical: 2),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4),
color: Colors.grey.shade300,
color: midColor,
),
child: const Text("...", style: TextStyle(color: Colors.white, fontSize: 10)),
)));
@@ -90,7 +91,7 @@ class SchedulerCalendarWidgetState extends State<SchedulerCalendarWidget> {
alignment: !isEvent(widget.data, date) ? Alignment.center : Alignment.topCenter,
margin:const EdgeInsets.all(2.0),
decoration: BoxDecoration(
border: Border.all(color: Colors.grey.shade300),
border: Border.all(color: midColor),
shape: BoxShape.rectangle,
),
child: !isEvent(widget.data, date) ? Text(
@@ -106,8 +107,8 @@ class SchedulerCalendarWidgetState extends State<SchedulerCalendarWidget> {
alignment: Alignment.center,
margin: const EdgeInsets.all(2.0),
decoration: BoxDecoration(
border: Border.all(color: Colors.grey.shade300),
color: Colors.grey.shade300,
border: Border.all(color: midColor),
color: midColor,
shape: BoxShape.rectangle,
),
child: Text(
@@ -119,7 +120,7 @@ class SchedulerCalendarWidgetState extends State<SchedulerCalendarWidget> {
alignment: !isEvent(widget.data, date) ? Alignment.center : Alignment.topCenter,
margin: const EdgeInsets.all(2.0),
decoration: BoxDecoration(
border: Border.all(color: const Color.fromRGBO(38, 166, 154, 1), width: 2),
border: Border.all(color: lightColor, width: 2),
shape: BoxShape.rectangle,
),
child: !isEvent(widget.data, date) ? Text(