How to rewrite this to awoid Don't use 'BuildContext's across async gaps. warning.
onPressed: () async {
  if (snapshot.hasData) {
    final isRapportExist = await bloc.isRapportExist();
    if (isRapportExist) {
      return;
    }
    bloc.submitRapport();
    Navigator.pop(context, true); //Don't use 'BuildContext's across async gaps.
  }
},
In such cases usully mounted property used, but where it comes from?
if(!mounted) return; //Undefined name 'mounted'.
Navigator.pop(context, true);