Howt to expand if the child node is beyond the screen

Issue #16 resolved
Abdulla I created an issue

Comments (2)

  1. Kevin Armstrong

    I do think the TreeView could use the ability to prevent the labels from wrapping. I'll have to see if its possible to resolve that wrapping.

    This solution should work for the time.

    Container(
      child: SingleChildScrollView(
        physics: ClampingScrollPhysics(),
        scrollDirection: Axis.horizontal,
        child: Container(
          width: MediaQuery.of(context).size.width * 2,
          child: TreeView(
            physics: ClampingScrollPhysics(),
            controller: _treeViewController,
            onExpansionChanged: (key, expanded) => _expandNode(key, expanded),
            onNodeTap: _onTap,
            theme: _treeViewTheme,
          ),
        ),
      ),
    )
    

    The key part is wrapping the TreeView in a Container and increasing its size. I used twice the screen width here. Then wrap that Container in a SingleChildScrollView with a Axis.horizontal for the scrollDirection.

  2. Log in to comment