oc-search porting to flutter (missing compose + workflow editor)

This commit is contained in:
mr
2024-07-05 09:24:40 +02:00
parent a7f34db2e0
commit 7e4687853f
220 changed files with 10528 additions and 119 deletions

View File

@@ -0,0 +1,48 @@
import 'package:flutter/material.dart';
import 'package:oc_front/models/search.dart';
import 'package:oc_front/pages/catalog.dart';
import 'package:oc_front/core/models/cart.dart';
import 'package:oc_front/widgets/items/item_row.dart';
GlobalKey<EndDrawerWidgetState> endDrawerKey = GlobalKey<EndDrawerWidgetState>();
class EndDrawerWidget extends StatefulWidget {
final List<AbstractItem>? items;
EndDrawerWidget ({ this.items }): super(key: endDrawerKey);
@override EndDrawerWidgetState createState() => EndDrawerWidgetState();
}
class EndDrawerWidgetState extends State<EndDrawerWidget> {
@override Widget build(BuildContext context) {
List<ItemRowWidget> itemRows = WorkspaceLocal.items.map(
(e) => ItemRowWidget(contextWidth: 400, item: e, keys: [endDrawerKey, CatalogFactory.key],)).toList();
return Container(
color: Colors.white,
width: 400,
height: MediaQuery.of(context).size.height,
child: SingleChildScrollView(
child: Column( children: [
Container(
width: 400,
height: 50,
decoration: const BoxDecoration(color: Color.fromRGBO(38, 166, 154, 1)),
child: const Center(
child: Row( mainAxisAlignment: MainAxisAlignment.center,
children: [
Padding(padding: EdgeInsets.only(right: 20), child: Icon(Icons.shopping_cart_outlined, size: 18, color: Colors.white)),
Text("Workspace", style: TextStyle(fontSize: 18, color: Colors.white, fontWeight: FontWeight.w600))
])
),
),
itemRows.isEmpty ? Container( height: MediaQuery.of(context).size.height - 50,
color: Colors.grey.shade300,
child: const Center(child: Text("WORKSPACE IS EMPTY",
style: TextStyle(fontSize: 25, fontWeight: FontWeight.w600, color: Colors.white))))
: Container( child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Row( children: itemRows)
)),
])
)
);
}
}