statusBarHeight property

double get statusBarHeight

状态栏高度 dp 刘海屏会更高

Implementation

double get statusBarHeight {
  if (context == null) {
    return 20;
  }
  if (_statusBarHeight == null || _statusBarHeight == 0) {
    var view = View.of(context!);
    _statusBarHeight = view.padding.top;
  }
  return (_statusBarHeight ?? 0) / pixelRatio;
}