Dashboard chart flow
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:oc_front/models/search.dart';
|
||||
import 'package:oc_front/widgets/items_details/data_item.dart';
|
||||
import 'package:oc_front/widgets/items/items_details/data_item.dart';
|
||||
|
||||
class ItemWidget extends StatefulWidget {
|
||||
AbstractItem item;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'dart:convert';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:oc_front/models/search.dart';
|
||||
import 'package:oc_front/core/models/cart.dart';
|
||||
import 'package:oc_front/core/models/workspace_local.dart';
|
||||
import 'package:oc_front/core/services/router.dart';
|
||||
|
||||
const List<GlobalKey<State>> _empty = [];
|
||||
@@ -10,8 +10,9 @@ class ItemRowWidget extends StatefulWidget {
|
||||
bool readOnly = false;
|
||||
double contextWidth = 0;
|
||||
AbstractItem item;
|
||||
bool low = false;
|
||||
List<GlobalKey<State>> keys = [];
|
||||
ItemRowWidget ({ super.key,
|
||||
ItemRowWidget ({ super.key, this.low = false,
|
||||
required this.contextWidth, this.readOnly = false, required this.item, this.keys = _empty });
|
||||
@override ItemRowWidgetState createState() => ItemRowWidgetState();
|
||||
}
|
||||
@@ -31,17 +32,17 @@ class ItemRowWidgetState extends State<ItemRowWidget> {
|
||||
height: 100,
|
||||
decoration: BoxDecoration( border: Border(bottom: BorderSide(color: Colors.grey.shade300)) ),
|
||||
child: Row( children: [
|
||||
Padding( padding: const EdgeInsets.all(10),
|
||||
widget.low ? Container( padding: EdgeInsets.only(left: 10),) : Padding( padding: const EdgeInsets.all(10),
|
||||
child: image ?? Image.network('https://get-picto.com/wp-content/uploads/2024/01/logo-instagram-png.webp',
|
||||
height: imageSize, width: imageSize)),
|
||||
Container(
|
||||
width: widget.contextWidth - (imageSize + 20) - endWidth,
|
||||
width: widget.low ? widget.contextWidth - 20 : widget.contextWidth - (imageSize + 20) - endWidth,
|
||||
child: Padding(padding: widget.contextWidth != MediaQuery.of(context).size.width ?
|
||||
const EdgeInsets.symmetric(horizontal: 10) : const EdgeInsets.symmetric(horizontal: 20),
|
||||
child: Column(crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.center, children: [
|
||||
Row( children: [
|
||||
Container(padding: const EdgeInsets.symmetric(vertical: 5, horizontal: 10),
|
||||
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 :
|
||||
@@ -54,7 +55,7 @@ class ItemRowWidgetState extends State<ItemRowWidget> {
|
||||
style: const TextStyle(fontSize: 10, color: Colors.white, fontWeight: FontWeight.w600)),
|
||||
),
|
||||
Expanded( child: Text(widget.item.name?.toUpperCase() ?? "",
|
||||
style: const TextStyle(fontSize: 20, overflow: TextOverflow.ellipsis, fontWeight: FontWeight.w600, color: Color(0xFFF67C0B9))),
|
||||
style: TextStyle(fontSize: widget.low ? 14 : 20, overflow: TextOverflow.ellipsis, fontWeight: FontWeight.w600, color: Color(0xFFF67C0B9))),
|
||||
)
|
||||
]),
|
||||
Text( "From ${widget.item.owner ?? "unknown owner"}",
|
||||
@@ -63,7 +64,7 @@ class ItemRowWidgetState extends State<ItemRowWidget> {
|
||||
],)
|
||||
)
|
||||
),
|
||||
Container(
|
||||
widget.low ? Container() : Container(
|
||||
width: endWidth,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
@@ -108,8 +109,8 @@ class ItemRowWidgetState extends State<ItemRowWidget> {
|
||||
])
|
||||
)]),
|
||||
);
|
||||
return widget.readOnly ? w : InkWell( mouseCursor: SystemMouseCursors.click,
|
||||
onTap: () { AppRouter.zones.last.go(context, { "id" : widget.item.id ?? "" }); },
|
||||
return widget.readOnly || widget.low ? w : InkWell( mouseCursor: SystemMouseCursors.click,
|
||||
onTap: () { AppRouter.catalogItem.go(context, { "id" : widget.item.id ?? "" }); },
|
||||
child: w );
|
||||
}
|
||||
}
|
||||
27
lib/widgets/items/items_details/data_item.dart
Normal file
27
lib/widgets/items/items_details/data_item.dart
Normal file
@@ -0,0 +1,27 @@
|
||||
|
||||
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: EdgeInsets.symmetric(vertical: 20, horizontal: 100),
|
||||
child: Text("type : ${widget.item.dtype ?? "unknown type"}",
|
||||
style: TextStyle(fontSize: 15, fontWeight: FontWeight.w600))),
|
||||
Padding(padding: EdgeInsets.symmetric(horizontal: 100, vertical: 20),
|
||||
child: Text("location : ${widget.item.location ?? "unknown location"}",
|
||||
style: TextStyle(fontSize: 15, fontWeight: FontWeight.w600))),
|
||||
Padding(padding: EdgeInsets.symmetric(horizontal: 100, vertical: 20),
|
||||
child: Text("protocol : ${widget.item.protocol.isEmpty ? "no protocol founded" : widget.item.protocol.join(",")}",
|
||||
style: TextStyle(fontSize: 15, fontWeight: FontWeight.w600))),
|
||||
Padding(padding: EdgeInsets.symmetric(horizontal: 100, vertical: 20),
|
||||
child: Text("ex : ${widget.item.example ?? "no example"}",
|
||||
style: TextStyle(fontSize: 15, fontWeight: FontWeight.w600))),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user