oc-front/lib/widgets/items/item.dart

41 lines
1.7 KiB
Dart
Raw Normal View History

import 'package:flutter/material.dart';
2024-11-08 13:59:22 +01:00
import 'package:oc_front/main.dart';
import 'package:oc_front/models/search.dart';
2024-07-17 13:28:02 +02:00
import 'package:oc_front/widgets/items/items_details/data_item.dart';
class ItemWidget extends StatefulWidget {
AbstractItem item;
ItemWidget ({ super.key, required this.item });
@override ItemWidgetState createState() => ItemWidgetState();
}
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); }
2024-11-08 13:59:22 +01:00
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(
2024-11-08 13:59:22 +01:00
height: getHeight(context) - 300,
child: SingleChildScrollView(
child: Column( children: [
widget.item.description == null ? Container() : Container(
2024-11-08 13:59:22 +01:00
width: getMainWidth(context),
alignment: Alignment.center,
2024-11-08 13:59:22 +01:00
decoration: BoxDecoration(border: Border(bottom: BorderSide(color: midColor))),
padding: const EdgeInsets.all(30),
child: Text(widget.item.description!,
style: TextStyle(fontSize: 15, color: Colors.grey, fontWeight: FontWeight.w500))),
Container(padding: const EdgeInsets.all(30),
2024-11-08 13:59:22 +01:00
color: midColor,
width: getMainWidth(context) / 2,
child: w
)
]
)
)
);
}
}