Identical Flutter Widgets in Row throwing error? Identical Flutter Widgets in Row throwing error? flutter flutter

Identical Flutter Widgets in Row throwing error?


Try adding a unique heroTag for each of the FloatingActionButtons, so that Flutter does not confuse the two button with each other, something like:

new Row(        mainAxisAlignment: MainAxisAlignment.center,        children: <Widget>[          new FloatingActionButton(              heroTag: "Decline",              child: new Icon(Icons.remove), onPressed: _decline),          new Padding(padding: new EdgeInsets.all(10.0)),          new Text(            _count.toString(),            style: new TextStyle(                fontSize: 40.0,                fontWeight: FontWeight.bold,                color: Colors.black),          ),          new Padding(padding: new EdgeInsets.all(10.0)),          new FloatingActionButton(              heroTag: "Increment",              child: new Icon(Icons.add), onPressed: _increment),        ],      ),


We cannot use more than one floating action button on the same page so there are two possibilities.

  1. Don't use more than one floating action button (Flutter is awesomeso there are other ways to get the same result)
  2. Don't leave heroTag null.