Skip to content

How can I manually use a controller to update a node’s data? #32

Description

@onism0106

My project uses BLoC, not MobX.

When building a custom node (for example, an ApiRequest node), there is a dropdown menu inside the node. After selecting an item from the dropdown, I want to update the data of that node.

Widget _buildNode(Node<LogicNode> node) {
  switch (node.data) {
    case ApiRequest():
      return BlocBuilder<LogicFlowBloc, LogicFlowState>(
        builder: (context, state) {
          return FDropdown(
            dataItems: state.apiList,
            itemBuilder: (v) {
              return Text(v.apiName);
            },
            onChanged: (v) {
              // I want to update the node's data here
            },
          );
        },
      );
    default:
      return Center(
        child: Text((node.data).displayName),
      );
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions