oc-search porting to flutter (missing compose + workflow editor)
This commit is contained in:
48
lib/core/sections/end_drawer.dart
Normal file
48
lib/core/sections/end_drawer.dart
Normal 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)
|
||||
)),
|
||||
])
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user