Shared space

This commit is contained in:
mr
2024-11-19 15:06:22 +01:00
parent 062042b590
commit 6be0fbac7d
23 changed files with 595 additions and 131 deletions

View File

@@ -10,13 +10,6 @@ import 'package:oc_front/pages/abstract_page.dart';
class CatalogFactory implements AbstractFactory {
@override GlobalKey getKey() { return key; }
static GlobalKey<CatalogPageWidgetState> key = GlobalKey<CatalogPageWidgetState>();
@override void clear() {
mainKey?.currentState?.setState(() {
HeaderConstants.headerKey.currentState?.setState(() {});
HeaderConstants.headerWidget?.setState(() {});
key.currentState?.widget.items = [];
});
}
@override bool searchFill() { return key.currentState?.widget.items.isEmpty ?? true; }
@override Widget factory(GoRouterState state, List<String> args) { return CatalogPageWidget(); }
@override void search(BuildContext context, bool special) {
@@ -46,9 +39,8 @@ class CatalogPageWidgetState extends State<CatalogPageWidget> {
@override Widget build(BuildContext context) {
if (widget.items.isEmpty) { return Container(); }
return Column( children : [
SizedBox(
width: getMainWidth(context),
height: getMainHeight(context),
SizedBox( width: getMainWidth(context),
height: getMainHeight(context) - 50,
child: SingleChildScrollView( child: CatalogWidget(items: CatalogFactory.key.currentState?.widget.items, itemWidth: widget.itemWidth) )),
]
);