xxxxxxxxxx
import 'package:flutter/material.dart';
bool isKeyboardVisible(BuildContext context) {
final double viewInsetsBottom = MediaQuery.of(context).viewInsets.bottom;
return viewInsetsBottom > 0;
}
xxxxxxxxxx
if(MediaQuery.of(context).viewInsets.bottom != 0.0) {
return const Offstage();
}