showSnackbar function

dynamic showSnackbar(
  1. String text, {
  2. int? seconds,
  3. required BuildContext context,
  4. bool debugMode = false,
  5. bool storeLogs = false,
})

Implementation

showSnackbar(String text,{int? seconds, required BuildContext context, bool debugMode = false, bool storeLogs = false}){
  if(debugMode==false || kDebugMode==false)
  ScaffoldMessenger.of(context!).showSnackBar(
      SnackBar(content: Text(text),

        duration: Duration(seconds:seconds??2),
        // margin: const EdgeInsets.symmetric(horizontal: 16, vertical: 16),
        // behavior: SnackBarBehavior.floating,
      )
  );

  // if(storeLogs==true ){
  //
  //   Map<String,dynamic> request = {
  //     'time': Timestamp.now(),
  //     'message': text
  //   };
  //
  //   if(userData!=null){
  //     FirebaseCollections.users.doc(userData?.userId).collection("snackbarlogs").add(request);
  //   }
  //   roughPageLogs.add('${DateTime.now()} $text');
  //
  // }
}