Major Change Inputs & Co
This commit is contained in:
@@ -1,22 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:oc_front/widgets/inputs/sub_text_input.dart';
|
||||
|
||||
class ComputeFormsWidget extends StatefulWidget {
|
||||
dynamic item;
|
||||
ComputeFormsWidget ({ super.key, required this.item });
|
||||
@override ComputeFormsWidgetState createState() => ComputeFormsWidgetState();
|
||||
}
|
||||
class ComputeFormsWidgetState extends State<ComputeFormsWidget> {
|
||||
@override Widget build(BuildContext context) {
|
||||
return Column( children: [
|
||||
SubTextInputWidget(subkey: "technology", width: 180, empty: false, change: (value) {
|
||||
}, initialValue: widget.item.getTechnology(), readOnly: true,),
|
||||
SubTextInputWidget(subkey: "architecture", width: 180, empty: false, change: (value) {
|
||||
}, initialValue: widget.item.architecture, readOnly: true,),
|
||||
SubTextInputWidget(subkey: "access", width: 180, empty: false, change: (value) {
|
||||
}, initialValue: widget.item.getAccess(), readOnly: true,),
|
||||
SubTextInputWidget(subkey: "localisation", width: 180, empty: false, change: (value) {
|
||||
}, initialValue: widget.item.localisation, readOnly: true,),
|
||||
]);
|
||||
}
|
||||
}
|
||||
105
lib/widgets/forms/container_forms.dart
Normal file
105
lib/widgets/forms/container_forms.dart
Normal file
@@ -0,0 +1,105 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_flow_chart/flutter_flow_chart.dart';
|
||||
import 'package:oc_front/models/resources/processing.dart';
|
||||
import 'package:oc_front/models/resources/resources.dart';
|
||||
import 'package:oc_front/widgets/forms/sub_expose_forms.dart';
|
||||
import 'package:oc_front/widgets/inputs/sub_text_input.dart';
|
||||
|
||||
// ignore: must_be_immutable
|
||||
class ContainerFormsWidget extends StatefulWidget {
|
||||
int instanceID = 0;
|
||||
Dashboard dash;
|
||||
AbstractItem item;
|
||||
String elementID;
|
||||
ContainerFormsWidget({ super.key, required this.item, required this.dash, required this.elementID });
|
||||
@override ContainerFormsWidgetState createState() => ContainerFormsWidgetState();
|
||||
}
|
||||
|
||||
class ContainerFormsWidgetState extends State<ContainerFormsWidget> {
|
||||
@override Widget build(BuildContext context) {
|
||||
List<Widget> widgets = [];
|
||||
var instance = widget.item.getSelectedInstance();
|
||||
if (instance != null && instance is ProcessingInstance && instance.access?.container != null) {
|
||||
var container = instance.access!.container!;
|
||||
widgets.add(Container(
|
||||
padding: const EdgeInsets.only(bottom: 10),
|
||||
width: 180,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text("<CONTAINER>", style: const TextStyle(fontSize: 13, fontWeight: FontWeight.bold), textAlign: TextAlign.center),
|
||||
SubTextInputWidget(subkey: "image", width: 180, empty: false, change: (value) { },
|
||||
initialValue: container.image, readOnly: true),
|
||||
SubTextInputWidget(subkey: "command", width: 180, empty: false, change: (value) {
|
||||
container.command = value;
|
||||
for (var el in widget.dash.elements) {
|
||||
if (el.id == widget.elementID) {
|
||||
el.element = widget.item;
|
||||
break;
|
||||
}
|
||||
}
|
||||
widget.dash.saveDash(widget.dash.id, context);
|
||||
}, initialValue: container.command, readOnly: false,),
|
||||
SubTextInputWidget(subkey: "args", width: 180, empty: false, change: (value) {
|
||||
container.args = value;
|
||||
for (var el in widget.dash.elements) {
|
||||
if (el.id == widget.elementID) {
|
||||
el.element = widget.item;
|
||||
break;
|
||||
}
|
||||
}
|
||||
widget.dash.saveDash(widget.dash.id, context);
|
||||
},
|
||||
initialValue: container.args, readOnly: false,)
|
||||
],)
|
||||
));
|
||||
widgets.add(Container(
|
||||
width: 200, decoration: BoxDecoration( border: Border(bottom: BorderSide(color: Colors.grey))),
|
||||
));
|
||||
widgets.add(Container(
|
||||
padding: const EdgeInsets.symmetric(vertical: 10),
|
||||
width: 180,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Padding(padding: EdgeInsets.only(bottom: 5), child: Text("<EXPOSE>",
|
||||
style: TextStyle(fontSize: 13, fontWeight: FontWeight.bold), textAlign: TextAlign.center)),
|
||||
Row( children: [
|
||||
InkWell( onTap: () {
|
||||
container.exposes.add(Expose());
|
||||
var el = widget.dash.getElement(widget.elementID);
|
||||
el!.element = widget.item as dynamic;
|
||||
setState(() {});
|
||||
}, child:
|
||||
Container( margin: const EdgeInsets.only(top: 5),
|
||||
decoration: BoxDecoration(borderRadius: BorderRadius.circular(5), border: Border.all(color: Colors.grey, width: 1)),
|
||||
width: 125, height: 30,
|
||||
child: const Row( mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [ Padding( padding: EdgeInsets.only(right: 5), child: Icon(Icons.add)), Text("add expose")]),
|
||||
)
|
||||
),
|
||||
InkWell( onTap: () {
|
||||
if (container.exposes.isEmpty) { return; }
|
||||
container.exposes = container.exposes.sublist(0, container.exposes.length - 1);
|
||||
var el = widget.dash.getElement(widget.elementID);
|
||||
el!.element = widget.item as dynamic;
|
||||
setState(() {});
|
||||
}, child:
|
||||
Container( margin: const EdgeInsets.only(left: 5, top: 5),
|
||||
decoration: BoxDecoration(borderRadius: BorderRadius.circular(5), border: Border.all(color: Colors.grey, width: 1)),
|
||||
width: 45, height: 30,
|
||||
child: const Row( mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [ Icon(Icons.delete, color: Colors.black) ]),
|
||||
)
|
||||
)
|
||||
]),
|
||||
],)
|
||||
));
|
||||
for (var expose in container.exposes) {
|
||||
widgets.add(SubExposeFormsWidget( readOnly: true, width: 180, dash: widget.dash, empty: widgets.isEmpty,
|
||||
item: expose, elementID: widget.elementID));
|
||||
}
|
||||
}
|
||||
return Column(children: widgets);
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:oc_front/models/search.dart';
|
||||
import 'package:oc_front/widgets/forms/web_reference_forms.dart';
|
||||
|
||||
class DataFormsWidget extends StatefulWidget {
|
||||
DataItem item;
|
||||
String purpose = "";
|
||||
Function validate = () {};
|
||||
DataFormsWidget ({ super.key, required this.item });
|
||||
@override DataFormsWidgetState createState() => DataFormsWidgetState();
|
||||
}
|
||||
class DataFormsWidgetState extends State<DataFormsWidget> {
|
||||
@override Widget build(BuildContext context) {
|
||||
return Column( children: [
|
||||
WebReferenceFormsWidget(item: widget.item),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user