Giter Site home page Giter Site logo

flutter_device_type's People

Contributors

leogouveia avatar ominibyte avatar ziph0n avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

flutter_device_type's Issues

Wrongly identifies phone as tablet from Samsung A71

This package thinks the Samsung A71 and other long android devices are tablets:

Samsung A71 Spec:
1080 x 2400 pixels
6.7 inches

Result from Device.get():

Device
  hasNotch:true
  isAndroid:true
  isIos:false
  isIphoneX:false
  isPhone:false
  isTablet:true

Result from

Device.devicePixelRatio
2.325000047683716

Device.size
Size (Size(1080.0, 2400.0))

Device.height
2400.0

Device.width
1080.0

I wonder if it is todo with this code in flutter_device_type.dart L64:

// Recalculate for Android Tablet using device inches
    if (isAndroid) {
      final adjustedWidth = _calWidth() / devicePixelRatio;
      final adjustedHeight = _calHeight() / devicePixelRatio;
      final diagonalSizeInches = (Math.sqrt(
              Math.pow(adjustedWidth, 2) + Math.pow(adjustedHeight, 2))) /
          _ppi;
      //print("Dialog size inches is $diagonalSizeInches");
      if (diagonalSizeInches >= 7) { // <- It must think it is over 7 inches
        isTablet = true;
        isPhone = false;
      } else {
        isTablet = false;
        isPhone = true;
      }
    }

Nexus 7 Simulator Reported as Phone

A simulator based on Nexus 7, one of the built-in tablets, is being reported as a phone. The issue appears to be that the Nexus 7 screen calculation is 6.94 diagonal, just below your threshold for a tablet.

Null Safety Support

Hello, are there any plans for supporting null safety? Seems easy as it is only one file.
Please let me know if you need help migrating, I can create a PR.

Wrong device type recognized

This library returns

deviceIsTablet=false

on a bunch of tablets. This error does not occur every time, but it does happen again and again.

It also rarely happens in debug mode but mostly in release mode.

Tested devices: iPad mini, iPad Air 2, Galaxy Tab S6, Galaxy Tab A2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.