getWidth static method

double getWidth(
  1. BuildContext context, {
  2. String? className,
})

Implementation

static double getWidth (BuildContext  context, { String? className  }) {
  try {

    _clearCacheDiviceSizeWhenOrientationChange(context);

    if( isMobile() &&  widthFullSize != 0 ) {
      return widthFullSize;
    }
    widthFullSize =  MediaQuery.of(context).size.width;
    // Log.i( "DeviceTools - getScreenWidth() - result: $result ");
    return widthFullSize;
  }  catch (err) {
    if( className  != null ){
      //Log.e( "DeviceTools - getWidth() - err - className: $className ");
      return 500;
    }
    //   LogDebug.e( "DeviceTools - getWidth() - err: $err ");
    return 500;
  }
}