build method

Widget build()

Implementation

Widget build() {
  return BlocBuilder<AppScreenSizeCubit, AppScreenSizeState>(
    buildWhen: (previous, current) =>
        previous.deviceType != current.deviceType,
    builder: (context, s) {
      if (child == null) {
        return const NodeOverrideExecuter()
            .executeChild(context, state, const SizedBox.shrink());
      } else {
        return _handleVisibility(context, state, s)
            ? NodeBuilder(
                state: state.copyWith(node: child),
                onHover: () {
                  context
                      .read<TreeGlobalState>()
                      .onNodeHovered(child!, s.deviceType);
                },
                onTap: () {
                  context
                      .read<TreeGlobalState>()
                      .onNodeFocused(child!, s.deviceType);
                },
                onPanStart: () {
                  context
                      .read<TreeGlobalState>()
                      .onNodeFocused(child!, s.deviceType);
                },
                builder: (context, node) =>
                    const NodeOverrideExecuter().executeChild(
                  context,
                  state,
                  node.toWidget(
                    context: context,
                    state: state.copyWith(node: node),
                  ),
                ),
              )
            : const SizedBox.shrink();
      }
    },
  );
}