test
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
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:oc_front/core/services/router.dart';
|
||||
@@ -19,7 +20,7 @@ class ItemRowWidget extends StatefulWidget {
|
||||
class ItemRowWidgetState extends State<ItemRowWidget> {
|
||||
@override Widget build(BuildContext context) {
|
||||
double imageSize = widget.contextWidth <= 400 ? 0 : 80;
|
||||
var ratio = MediaQuery.of(context).size.width != widget.contextWidth ? 0.5 : 1; // 2;
|
||||
var ratio = getMainWidth(context) != widget.contextWidth ? 0.5 : 1; // 2;
|
||||
var itemWidth = (((widget.contextWidth - imageSize) / 3) - 80) / ratio;
|
||||
itemWidth = itemWidth > 100 ? 100 : ( itemWidth < 40 ? 40 : itemWidth );
|
||||
var endWidth = (itemWidth * ratio) + 80;
|
||||
@@ -31,7 +32,7 @@ class ItemRowWidgetState extends State<ItemRowWidget> {
|
||||
width: widget.contextWidth,
|
||||
height: 100,
|
||||
padding: EdgeInsets.only(left: imageSize == 0 ? 20 : 0),
|
||||
decoration: BoxDecoration( border: Border(bottom: BorderSide(color: Colors.grey.shade300)) ),
|
||||
decoration: BoxDecoration( border: Border(bottom: BorderSide(color: midColor)) ),
|
||||
child: Row( children: [
|
||||
widget.low ? Container( padding: const EdgeInsets.only(left: 10),) : Container( padding: const EdgeInsets.all(10),
|
||||
constraints: BoxConstraints(maxWidth: imageSize, minWidth: imageSize),
|
||||
@@ -39,7 +40,7 @@ class ItemRowWidgetState extends State<ItemRowWidget> {
|
||||
height: imageSize, width: imageSize)),
|
||||
Container(
|
||||
width: widget.low ? widget.contextWidth - 20 : widget.contextWidth - (imageSize + 20) - endWidth,
|
||||
child: Padding(padding: widget.contextWidth != MediaQuery.of(context).size.width ?
|
||||
child: Padding(padding: widget.contextWidth != getMainWidth(context) ?
|
||||
const EdgeInsets.symmetric(horizontal: 10) : const EdgeInsets.symmetric(horizontal: 20),
|
||||
child: Column(crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.center, children: [
|
||||
@@ -49,11 +50,11 @@ class ItemRowWidgetState extends State<ItemRowWidget> {
|
||||
decoration: BoxDecoration(
|
||||
color: isData(widget.item.topic) ? Colors.blue :
|
||||
isComputing(widget.item.topic) ? Colors.green :
|
||||
isDataCenter(widget.item.topic) ? Colors.orange :
|
||||
isStorage(widget.item.topic) ? Colors.red : Colors.grey,
|
||||
isCompute(widget.item.topic) ? Colors.orange :
|
||||
isStorage(widget.item.topic) ? redColor : Colors.grey,
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
),
|
||||
child: Text( MediaQuery.of(context).size.width < 600 ? "" : widget.item.topic.toString(),
|
||||
child: Text( getMainWidth(context) < 600 ? "" : widget.item.topic.toString(),
|
||||
style: const TextStyle(fontSize: 10, color: Colors.white, fontWeight: FontWeight.w600)),
|
||||
),
|
||||
Expanded( child: Text(widget.item.name?.toUpperCase() ?? "",
|
||||
@@ -85,8 +86,8 @@ class ItemRowWidgetState extends State<ItemRowWidget> {
|
||||
constraints: const BoxConstraints(maxWidth: 80),
|
||||
width: itemWidth,
|
||||
decoration: BoxDecoration(
|
||||
boxShadow: [BoxShadow(color: Colors.grey.shade300, spreadRadius: 1, blurRadius: 1, offset: const Offset(0, 1))],
|
||||
color: (WorkspaceLocal.hasItem(widget.item) ? Colors.red : const Color.fromRGBO(38, 166, 154, 1)),
|
||||
boxShadow: [BoxShadow(color: midColor, spreadRadius: 1, blurRadius: 1, offset: const Offset(0, 1))],
|
||||
color: (WorkspaceLocal.hasItem(widget.item) ? redColor : lightColor ),
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
),
|
||||
child: Icon(WorkspaceLocal.hasItem(widget.item) ? Icons.remove_shopping_cart : Icons.add_shopping_cart,
|
||||
@@ -101,8 +102,8 @@ class ItemRowWidgetState extends State<ItemRowWidget> {
|
||||
constraints: const BoxConstraints(maxWidth: 80, minWidth: 40),
|
||||
width: itemWidth,
|
||||
decoration: BoxDecoration(
|
||||
boxShadow: [BoxShadow(color: Colors.grey.shade300, spreadRadius: 1, blurRadius: 1, offset: const Offset(0, 1))],
|
||||
color: Colors.grey.shade300,
|
||||
boxShadow: [BoxShadow(color: midColor, spreadRadius: 1, blurRadius: 1, offset: const Offset(0, 1))],
|
||||
color: midColor,
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
),
|
||||
child: const Icon(Icons.favorite_border, color: Colors.white, size: 20 ))
|
||||
|
||||
Reference in New Issue
Block a user