deviceInfo property

DeviceInfo get deviceInfo

Get the device info based on the screen size

Implementation

DeviceInfo get deviceInfo {
  if (screenSize.width <= phoneInfo.screenSize.width) {
    return phoneInfo.copyWith(
      screenSize: screenSize,
    );
  } else if (screenSize.width <= tabletInfo.screenSize.width) {
    return tabletInfo.copyWith(
      screenSize: screenSize,
    );
  } else if (screenSize.width <= laptopInfo.screenSize.width) {
    return laptopInfo.copyWith(
      screenSize: screenSize,
    );
  } else {
    return desktopInfo.copyWith(
      screenSize: screenSize,
    );
  }
}