viewInsets property in:
MediaQuery.of(context).viewInsets.bottom returns a doubele.
When keyboard is off(not active), it is 0, when it is on(active), it not 0 ( that it; greater than 0). Device size determines it size.
If you need to determine size of a widget for example in your flutter code as a way of to illustrating determination of keyboard activeness or not, you can do something like:
Container(
height: MediaQuery.of(context).viewInsets.bottom == 0 ? 1 : 2,
width: MediaQuery.of(context).viewInsets.bottom == 0 ? 1 : 2,
)