title: Disable dismiss direction on Dismissible Widget
body: <p>I am writing an app to save your shopping list. Those item should be dismissable for editing the content or deleting the items. If another content is already in the textfield to be edited, then the swipe of a specific direction should be disabled. For now my Dismissible is looking like this.</p>
  
  <pre><code>    Dismissible(
      background: Container(
        alignment: Alignment.centerLeft,
        padding: EdgeInsets.only(left: 20.0),
        color: Colors.redAccent,
        child: Icon(Icons.delete, color: Colors.white),
      ),
      secondaryBackground: Container(
        alignment: Alignment.centerRight,
        padding: EdgeInsets.only(right: 20.0),
        color: Colors.orangeAccent,
        child: Icon(Icons.edit, color: Colors.white),
      ),
      child: Text("This is my dismissible widget"),
      onDismissed: (direction){
        if(direction == DismissDirection.startToEnd){
          Scaffold.of(context).showSnackBar(SnackBar(content: Text("Swipe to right")));
        } else if(direction == DismissDirection.endToStart){
          Scaffold.of(context).showSnackBar(SnackBar(content: Text("Swipe to right")));
        }
      },
    )
  </code></pre>
  
  <p><strong>SOLUTION:</strong></p>
  
  <p>Add dismiss directions like this</p>
  
  <pre><code>    Dismissible(
      background: Container(
        alignment: Alignment.centerLeft,
        padding: EdgeInsets.only(left: 20.0),
        color: Colors.redAccent,
        child: Icon(Icons.delete, color: Colors.white),
      ),
      secondaryBackground: Container(
        alignment: Alignment.centerRight,
        padding: EdgeInsets.only(right: 20.0),
        color: Colors.orangeAccent,
        child: Icon(Icons.edit, color: Colors.white),
      ),
      child: Text("This is my dismissible widget"),
      /*New*/
      direction: (textController.text.isEmpty
          ? DismissDirection.horizontal
          : DismissDirection.startToEnd
      ),
      /*New*/
      onDismissed: (direction){
        if(direction == DismissDirection.startToEnd){
          Scaffold.of(context).showSnackBar(SnackBar(content: Text("Swipe to right")));
        } else if(direction == DismissDirection.endToStart){
          Scaffold.of(context).showSnackBar(SnackBar(content: Text("Swipe to right")));
        }
      },
    )
  </code></pre>