NewSnackBar function

void NewSnackBar(
  1. BuildContext context,
  2. int duration
)

Implementation

void NewSnackBar(BuildContext context, int duration) async {
  final snackBar = SnackBar(
    content: NewView().height(100),
    backgroundColor: Colors.transparent,
    elevation: 0,
    behavior: SnackBarBehavior.fixed,
    // 고정된 스낵바 행동
    duration: Duration(seconds: duration),
    // margin 속성은 생략
  );

  ScaffoldMessenger.of(context).showSnackBar(snackBar);
}