Change position of a Flutter Snackbar Change position of a Flutter Snackbar android android

Change position of a Flutter Snackbar


You can do this by placing a container inside the snackbar. Since snackbar can take any widget and you can change its background color to transparent, you can use a container with custom padding and borders to give an illusion of positioning.

SnackBar(content: Container(  //color: Colors.white,  decoration: BoxDecoration(color: Colors.white, border: Border.all(width: 2.0, color: Colors.black), borderRadius: BorderRadius.circular(20)),  margin: EdgeInsets.fromLTRB(0, 0, 0, 75),  child: Padding(    padding: const EdgeInsets.all(8.0),    child: Text('Yay! A SnackBar!'),  ),), backgroundColor: Colors.transparent, elevation: 1000, behavior: SnackBarBehavior.floating,);


Unfortunately, no. But you can use https://api.flutter.dev/flutter/widgets/Overlay-class.html to display a Widget over another Widget (In your case over and above like a Tooltip widget) and create a Widget similar to Snackbar Widget