UI debugging + git ignore

This commit is contained in:
mr
2024-08-22 15:46:16 +02:00
parent ceeebfc964
commit 1db9ef0794
26 changed files with 1568 additions and 302 deletions

View File

@@ -1,3 +1,6 @@
import 'dart:async';
import 'dart:ui' as ui;
import 'package:flutter/material.dart';
import 'package:flutter_flow_chart/flutter_flow_chart.dart';
import 'package:oc_front/models/abstract.dart';
@@ -248,10 +251,21 @@ class ProcessingItem extends SerializerDeserializer<ProcessingItem> implements A
@override String getName() {
return name ?? "";
}
double? width;
double? height;
@override
double? getWidth() {
return width;
}
@override
double? getHeight() {
return height;
}
@override deserialize(dynamic json) {
try { json = json as Map<String, dynamic>;
} catch (e) { return ProcessingItem(); }
return ProcessingItem(
var w = ProcessingItem(
id: json.containsKey("id") ? json["id"] : null,
name: json.containsKey("name") ? json["name"] : null,
logo: json.containsKey("logo") ? json["logo"] : null,
@@ -274,6 +288,19 @@ class ProcessingItem extends SerializerDeserializer<ProcessingItem> implements A
scallingModel: json.containsKey("scalling_model") ? json["scalling_model"] : null,
diskIO: json.containsKey("disk_io") ? json["disk_io"] : null,
);
if (w.logo != null) {
//
var image = Image.network(w.logo!);
image.image
.resolve(const ImageConfiguration())
.addListener(
ImageStreamListener(
(ImageInfo info, bool _) {
w.width = info.image.width.toDouble();
w.height = info.image.height.toDouble();
}));
}
return w;
}
@override Map<String, dynamic> serialize() => {
"id": id,
@@ -336,13 +363,24 @@ class WorkflowItem extends SerializerDeserializer<WorkflowItem> implements Abstr
return id ?? "";
}
double? width;
double? height;
@override
double? getWidth() {
return width;
}
@override
double? getHeight() {
return height;
}
@override String getName() {
return name ?? "";
}
@override deserialize(dynamic json) {
try { json = json as Map<String, dynamic>;
} catch (e) { return WorkflowItem(); }
return WorkflowItem(
var w = WorkflowItem(
id: json.containsKey("id") ? json["id"] : null,
name: json.containsKey("name") ? json["name"] : null,
logo: json.containsKey("logo") ? json["logo"] : null,
@@ -358,6 +396,19 @@ class WorkflowItem extends SerializerDeserializer<WorkflowItem> implements Abstr
model: json.containsKey("resource_model") ? ResourceModel().deserialize(json["resource_model"]) : null,
workflowID: json.containsKey("workflow_id") ? json["workflow_id"] : null,
);
if (w.logo != null) {
//
var image = Image.network(w.logo!);
image.image
.resolve(const ImageConfiguration())
.addListener(
ImageStreamListener(
(ImageInfo info, bool _) {
w.width = info.image.width.toDouble();
w.height = info.image.height.toDouble();
}));
}
return w;
}
@override Map<String, dynamic> serialize() => {
"id": id,
@@ -420,10 +471,21 @@ class DataItem extends SerializerDeserializer<DataItem> implements AbstractItem<
@override String getID() {
return id ?? "";
}
double? width;
double? height;
@override
double? getWidth() {
return width;
}
@override
double? getHeight() {
return height;
}
@override deserialize(dynamic json) {
try { json = json as Map<String, dynamic>;
} catch (e) { return DataItem(); }
return DataItem(
var w = DataItem(
id: json.containsKey("id") ? json["id"] : null,
name: json.containsKey("name") ? json["name"] : null,
logo: json.containsKey("logo") ? json["logo"] : null,
@@ -441,6 +503,19 @@ class DataItem extends SerializerDeserializer<DataItem> implements AbstractItem<
dataType: json.containsKey("data_type") ? json["data_type"] : null,
exemple: json.containsKey("exemple") ? json["exemple"] : null,
);
if (w.logo != null) {
//
var image = Image.network(w.logo!);
image.image
.resolve(const ImageConfiguration())
.addListener(
ImageStreamListener(
(ImageInfo info, bool _) {
w.width = info.image.width.toDouble();
w.height = info.image.height.toDouble();
}));
}
return w;
}
@override Map<String, dynamic> serialize() => {
"id": id,
@@ -505,10 +580,21 @@ class DataCenterItem extends SerializerDeserializer<DataCenterItem> implements A
@override String getName() {
return name ?? "";
}
double? width;
double? height;
@override
double? getWidth() {
return width;
}
@override
double? getHeight() {
return height;
}
@override deserialize(dynamic json) {
try { json = json as Map<String, dynamic>;
} catch (e) { return DataCenterItem(); }
return DataCenterItem(
var w = DataCenterItem(
id: json.containsKey("id") ? json["id"] : null,
name: json.containsKey("name") ? json["name"] : null,
logo: json.containsKey("logo") ? json["logo"] : null,
@@ -526,6 +612,19 @@ class DataCenterItem extends SerializerDeserializer<DataCenterItem> implements A
gpus: json.containsKey("gpus") ? fromListJson(json["gpus"], GPU()) : [],
ram: json.containsKey("ram") ? RAM().deserialize(json["ram"]) : null,
);
if (w.logo != null) {
//
var image = Image.network(w.logo!);
image.image
.resolve(const ImageConfiguration())
.addListener(
ImageStreamListener(
(ImageInfo info, bool _) {
w.width = info.image.width.toDouble();
w.height = info.image.height.toDouble();
}));
}
return w;
}
@override Map<String, dynamic> serialize() => {
"id": id,
@@ -680,10 +779,20 @@ class StorageItem extends SerializerDeserializer<StorageItem> implements Abstrac
@override String getID() {
return id ?? "";
}
double? width;
double? height;
@override
double? getWidth() {
return width;
}
@override
double? getHeight() {
return height;
}
@override deserialize(dynamic json) {
try { json = json as Map<String, dynamic>;
} catch (e) { return StorageItem(); }
return StorageItem(
var w = StorageItem(
id: json.containsKey("id") ? json["id"] : null,
name: json.containsKey("name") ? json["name"] : null,
logo: json.containsKey("logo") ? json["logo"] : null,
@@ -705,6 +814,19 @@ class StorageItem extends SerializerDeserializer<StorageItem> implements Abstrac
redundancy: json.containsKey("redundancy") ? json["redundancy"] : null,
throughput: json.containsKey("throughput") ? json["throughput"] : null,
);
if (w.logo != null) {
//
var image = Image.network(w.logo!);
image.image
.resolve(const ImageConfiguration())
.addListener(
ImageStreamListener(
(ImageInfo info, bool _) {
w.width = info.image.width.toDouble();
w.height = info.image.height.toDouble();
}));
}
return w;
}
@override Map<String, dynamic> serialize() => {
"id": id,