Latest Front with debug
This commit is contained in:
@@ -2,27 +2,40 @@ import 'package:flutter/material.dart';
|
||||
import 'package:oc_front/core/sections/header/menu.dart';
|
||||
import 'package:oc_front/core/sections/header/search.dart';
|
||||
import 'package:oc_front/core/services/router.dart';
|
||||
import 'package:oc_front/widgets/menu_clipper/clipper_menu.dart';
|
||||
import 'package:oc_front/widgets/menus/clipper_menu.dart';
|
||||
|
||||
class HeaderConstants {
|
||||
static final List<RouterItem> noHeader = [
|
||||
AppRouter.workflowItem,
|
||||
AppRouter.workflowIDItem,
|
||||
];
|
||||
static HeaderWidgetState? headerWidget;
|
||||
static double height = 200;
|
||||
static String? title;
|
||||
static String? description;
|
||||
|
||||
static setTitle(String? v) {
|
||||
title = v;
|
||||
HeaderConstants.headerWidget?.setState(() {});
|
||||
}
|
||||
|
||||
static setDescription(String? v) {
|
||||
description = v;
|
||||
HeaderConstants.headerWidget?.setState(() {});
|
||||
}
|
||||
|
||||
static bool isNoHeader(String route) {
|
||||
return noHeader.where((element) => element.route == route).isNotEmpty;
|
||||
}
|
||||
}
|
||||
|
||||
GlobalKey<HeaderWidgetState> headerWidgetKey = GlobalKey<HeaderWidgetState>();
|
||||
class HeaderWidget extends StatefulWidget {
|
||||
HeaderWidget () : super(key: headerWidgetKey);
|
||||
HeaderWidget () : super(key: null);
|
||||
@override HeaderWidgetState createState() => HeaderWidgetState();
|
||||
}
|
||||
class HeaderWidgetState extends State<HeaderWidget> {
|
||||
@override Widget build(BuildContext context) {
|
||||
headerWidgetKey = GlobalKey<HeaderWidgetState>();
|
||||
HeaderConstants.headerWidget = this;
|
||||
headerMenuKey.currentState?.closeMenu();
|
||||
HeaderConstants.height = HeaderConstants.isNoHeader(AppRouter.currentRoute.route) ? 50 : 200;
|
||||
return Column( children: [
|
||||
|
||||
Reference in New Issue
Block a user