Flutter exception when having 2 FloatingActionButton
Ok, I found out that adding heroTag: null to the properties of the FloatingActionButton solved the issue.
The part of the code that caused the exception is now the following and seems to be working.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | new FloatingActionButton( onPressed: () { getImage(ImageSource.camera); }, tooltip: 'Take a Photo', child: new Icon(Icons.camera_alt), heroTag: null, ), new FloatingActionButton( onPressed: () { getImage(ImageSource.gallery); }, tooltip: 'Pick Image from gallery', child: new Icon(Icons.photo_library), heroTag: null, ), |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.