snackbar2 method

Widget? snackbar2(
  1. dynamic context, {
  2. required String text,
  3. bool? isFloating = false,
})

Implementation

Widget? snackbar2(context, {required String text, bool? isFloating = false}) {
  bool show = true;
  Timer(const Duration(seconds: 5), () {
    show = false;
  });

  if (show) {
    return Container(
      height: 100,
      width: 100,
      color: Colors.green,
    );
  }
  return null;
}