showInCenter static method
显示在中间。如不设置duration则会自动根据内容长度来计算(更友好,最长5秒)
Implementation
static void showInCenter(
{required String text,
required BuildContext context,
Duration? duration}) {
show(
text,
context,
duration: duration,
gravity: ToastGravity.center,
);
}