The content
property of the Snackbar
takes a Widget
.
In your case, you can pass the Row
widget since you want to place items side by side( your icon and your text).
Check the code below, it works fine:
SnackBar(
// background color of your snack-bar
backgroundColor: Colors.red,
// make the content property take a Row
content: Row(
children: <Widget>[
// add your preferred icon here
Icon(
Icons.close,
color: Colors.white,
),
// add your preferred text content here
Text(_accion_toast + ". " + mensaje),
],
),
// the duration of your snack-bar
duration: Duration(milliseconds: 1500),
);
}