Skip to content

moving widgets up or down in the tree #461

Closed
@mit-mit

Description

@mit-mit

From @HansMuller on March 8, 2016 17:31

Say I have this:

  Widget build(BuildContext context) {
    return new Scaffold(
      body: new GestureDetector(
        onTap: () { startResize(); },
        child: new Center(
          child: new Container(
            width: 200.0,
            height: 300.0,
            decoration: new BoxDecoration(backgroundColor: const Color(0xFF00FF00))
          )
        )
      )
    );
  }

And I want to move the GestureDetector "down" so that it wraps its Container descendant.

  Widget build(BuildContext context) {
    return new Scaffold(
       body: new Center(
        child: new GestureDetector(
          onTap: () { startResize(); },
          child: new Container(
            width: 200.0,
            height: 300.0,
            decoration: new BoxDecoration(backgroundColor: const Color(0xFF00FF00))
          )
        )
      )
    );
  }

Currently this is a pretty tedious manual process, particularly when the tree the widget is within is relatively complex.

Changes like this are very common in Flutter application building.

I wish Widget tree operations like this were relatively trivial. For example if there was a graphical view of the corresponding tree, then one could just drag and drop nodes.

Copied from original issue: flutter/flutter#2486

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions