Вы можете использовать свойство Duration на снэк-баре
Пример
final snackBar = SnackBar(
content: Text('Cart:'+countProducts.toString()+" Products($countCost:sum)",style: TextStyle(color: Colors.black),),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.only(topLeft:Radius.circular(22),topRight:Radius.circular(22))),
backgroundColor: Colors.white70,
action: SnackBarAction(
textColor: Colors.blueAccent,
label: "Buy",
onPressed: () {
// Some code to undo the change.
},
),
duration: Duration(seconds: double.infinity),
);
, используя Duration(seconds: double.infinity)
Не уверен, что это лучший вариант.
РЕДАКТИРОВАТЬ
Вы можете попробовать следующее вместо использования double.infinity
Duration(days: 365)
Ссылка