missing files
This commit is contained in:
24
lib/widgets/items/infos.dart
Normal file
24
lib/widgets/items/infos.dart
Normal file
@@ -0,0 +1,24 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:oc_front/models/resources/resources.dart';
|
||||
|
||||
// ignore: must_be_immutable
|
||||
class InfosWidget extends StatefulWidget {
|
||||
AbstractItem item;
|
||||
InfosWidget ({ super.key, required this.item });
|
||||
@override InfosWidgetState createState() => InfosWidgetState();
|
||||
}
|
||||
class InfosWidgetState extends State<InfosWidget> {
|
||||
@override Widget build(BuildContext context) {
|
||||
List<Widget> children = [];
|
||||
var obj = widget.item.infos();
|
||||
for (var key in obj.keys) {
|
||||
children.add(
|
||||
Padding(padding: const EdgeInsets.symmetric(vertical: 20, horizontal: 100),
|
||||
child: Text("$key : ${obj[key] ?? "no $key"}",
|
||||
style: const TextStyle(fontSize: 15, fontWeight: FontWeight.w600))),
|
||||
);
|
||||
}
|
||||
return Wrap( children: children);
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,8 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:oc_front/main.dart';
|
||||
import 'package:oc_front/models/search.dart';
|
||||
import 'package:oc_front/widgets/items/items_details/data_item.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:oc_front/models/resources/resources.dart';
|
||||
|
||||
// ignore: must_be_immutable
|
||||
class ItemWidget extends StatefulWidget {
|
||||
AbstractItem item;
|
||||
ItemWidget ({ super.key, required this.item });
|
||||
@@ -12,15 +11,10 @@ class ItemWidget extends StatefulWidget {
|
||||
class ItemWidgetState extends State<ItemWidget> {
|
||||
@override Widget build(BuildContext context) {
|
||||
Widget w = Container();
|
||||
/* if (isData(widget.item.topic)) { w = DataItemWidget(item: widget.item as DataItem); }
|
||||
else if (isComputing(widget.item.topic)) { w = DataItemWidget(item: widget.item as DataItem); }
|
||||
else if (isCompute(widget.item.topic)) { w = DataItemWidget(item: widget.item as DataItem); }
|
||||
else if (isStorage(widget.item.topic)) { w = DataItemWidget(item: widget.item as DataItem); } */
|
||||
|
||||
return Container(
|
||||
return SizedBox(
|
||||
height: getHeight(context) - 300,
|
||||
child: SingleChildScrollView(
|
||||
child: Column( children: [
|
||||
child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [
|
||||
widget.item.description == null ? Container() : Container(
|
||||
width: getMainWidth(context),
|
||||
alignment: Alignment.center,
|
||||
@@ -29,10 +23,8 @@ class ItemWidgetState extends State<ItemWidget> {
|
||||
child: Text(widget.item.description!,
|
||||
style: TextStyle(fontSize: 15, color: Colors.grey, fontWeight: FontWeight.w500))),
|
||||
Container(padding: const EdgeInsets.all(30),
|
||||
color: midColor,
|
||||
width: getMainWidth(context) / 2,
|
||||
child: w
|
||||
)
|
||||
alignment: Alignment.topLeft,
|
||||
color: midColor, width: getMainWidth(context) / 2, child: w)
|
||||
]
|
||||
)
|
||||
)
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import 'dart:convert';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:oc_front/main.dart';
|
||||
import 'package:oc_front/models/search.dart';
|
||||
import 'package:oc_front/core/models/workspace_local.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:oc_front/core/services/router.dart';
|
||||
import 'package:oc_front/models/resources/resources.dart';
|
||||
import 'package:oc_front/core/models/workspace_local.dart';
|
||||
|
||||
const List<GlobalKey<State>> _empty = [];
|
||||
// ignore: must_be_immutable
|
||||
@@ -38,7 +37,7 @@ class ItemRowWidgetState extends State<ItemRowWidget> {
|
||||
constraints: BoxConstraints(maxWidth: imageSize, minWidth: imageSize),
|
||||
child: image ?? Image.network('https://get-picto.com/wp-content/uploads/2024/01/logo-instagram-png.webp',
|
||||
height: imageSize, width: imageSize)),
|
||||
Container(
|
||||
SizedBox(
|
||||
width: widget.low ? widget.contextWidth - 20 : widget.contextWidth - (imageSize + 20) - endWidth,
|
||||
child: Padding(padding: widget.contextWidth != getMainWidth(context) ?
|
||||
const EdgeInsets.symmetric(horizontal: 10) : const EdgeInsets.symmetric(horizontal: 20),
|
||||
@@ -48,10 +47,7 @@ class ItemRowWidgetState extends State<ItemRowWidget> {
|
||||
widget.low ? Container() : Container(padding: const EdgeInsets.symmetric(vertical: 5, horizontal: 10),
|
||||
margin: const EdgeInsets.only(right: 20),
|
||||
decoration: BoxDecoration(
|
||||
color: isData(widget.item.topic) ? Colors.blue :
|
||||
isComputing(widget.item.topic) ? Colors.green :
|
||||
isCompute(widget.item.topic) ? Colors.orange :
|
||||
isStorage(widget.item.topic) ? redColor : Colors.grey,
|
||||
color: getColor(widget.item.topic),
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
),
|
||||
child: Text( getMainWidth(context) < 600 ? "" : widget.item.topic.toString(),
|
||||
@@ -61,13 +57,13 @@ class ItemRowWidgetState extends State<ItemRowWidget> {
|
||||
style: TextStyle(fontSize: widget.low ? 14 : 20, overflow: TextOverflow.ellipsis, fontWeight: FontWeight.w600, color: Color(0xFFF67C0B9))),
|
||||
)
|
||||
]),
|
||||
Text( "From ${widget.item.owner ?? "unknown owner"}",
|
||||
widget.item.owners.isEmpty ? Container() : Text( "From ${widget.item.owners.map( (e) => e.name).join(", ")}",
|
||||
style: const TextStyle(fontSize: 14, color: Colors.grey, overflow: TextOverflow.ellipsis)),
|
||||
Text(widget.item.shortDescription ?? "", style: const TextStyle(fontSize: 12, overflow: TextOverflow.ellipsis)),
|
||||
],)
|
||||
)
|
||||
),
|
||||
widget.low ? Container() : Container(
|
||||
widget.low ? Container() : SizedBox(
|
||||
width: endWidth,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
@@ -91,7 +87,8 @@ class ItemRowWidgetState extends State<ItemRowWidget> {
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
),
|
||||
child: Icon(WorkspaceLocal.hasItem(widget.item) ? Icons.remove_shopping_cart : Icons.add_shopping_cart,
|
||||
color: Colors.white, size: 20 ))
|
||||
color: Colors.white, size: 20 )
|
||||
)
|
||||
),
|
||||
...(ratio > 1 ? [Padding( padding: const EdgeInsets.only(left: 20),
|
||||
child: InkWell(
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:oc_front/models/search.dart';
|
||||
|
||||
class DataItemWidget extends StatefulWidget {
|
||||
DataItem item;
|
||||
DataItemWidget ({ super.key, required this.item });
|
||||
@override DataItemWidgetState createState() => DataItemWidgetState();
|
||||
}
|
||||
class DataItemWidgetState extends State<DataItemWidget> {
|
||||
@override Widget build(BuildContext context) {
|
||||
return Wrap( children: [
|
||||
Padding(padding: const EdgeInsets.symmetric(vertical: 20, horizontal: 100),
|
||||
child: Text("type : ${widget.item.type ?? "unknown type"}",
|
||||
style: const TextStyle(fontSize: 15, fontWeight: FontWeight.w600))),
|
||||
Padding(padding: const EdgeInsets.symmetric(horizontal: 100, vertical: 20),
|
||||
child: Text("protocol : ${widget.item.protocols.isEmpty ? "no protocol founded" : widget.item.protocols.join(",")}",
|
||||
style: const TextStyle(fontSize: 15, fontWeight: FontWeight.w600))),
|
||||
Padding(padding: const EdgeInsets.symmetric(horizontal: 100, vertical: 20),
|
||||
child: Text("ex : ${widget.item.exemple ?? "no example"}",
|
||||
style: const TextStyle(fontSize: 15, fontWeight: FontWeight.w600))),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user