show method
Display the created toast based on the position attribute
context
: the actual context of the application
Implementation
void show(BuildContext context) {
switch (position) {
case MOTION_TOAST_POSITION.center:
case MOTION_TOAST_POSITION.top:
Navigator.of(context).push(
PageRouteBuilder<Widget>(
pageBuilder: (BuildContext context, _, __) => this,
opaque: false,
),
);
break;
default:
showModalBottomSheet(
isDismissible: dismissable,
barrierColor: Colors.transparent,
context: context,
builder: (_) => this,
);
}
}