8000 GitHub - vishna/device_corner_radius: Find the corner radius of device
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

vishna/device_corner_radius

 
 

Repository files navigation

Device Corner Radius

This plugin uses native APIs to get the corner radius of the device.

For Android, it uses the WindowInsets API released along Android S.

Note: The WindowInsets API is only available on Android S (API 31) and above. Read more about the API here

For iOS, it read private _displayCornerRadius property of UIScreen class.

The Swift code used in this package was taken directly from @kylebshr's ScreenCorners

Usage

Import the package:

import 'package:device_corner_radius/device_corner_radius.dart';

And then use the getDeviceCornerRadius() method:

BorderRadius cornerRadius = await DeviceCornerRadius.getCornerRadius();

Reported Values for Apple Devices (by @kylebshr)

Device Value (pts)
iPhone 14 Pro / 14 Pro Max 55.0
iPhone 13 Pro Max / 14 Plus / 12 Pro Max 53.33
iPhone 14 / 13 Pro / 12 Pro / 12 47.33
iPhone 13 Mini / 12 Mini 44.0
iPhone 11 Pro / 11 Pro Max / X / XS / XS Max 39.0
iPhone XR / 11 41.5
iPad Air / iPad Pro 11-inch / 12.9-inch 18.0

TODO

  • Test on real Android devices

Contributors

Report Issues / Bugs

If you find any bugs or misplaced icons, please open an issue here.

License

This package is licensed under the MIT License

About

Find the corner radius of device

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 37.9%
  • CMake 31.2%
  • Dart 12.3%
  • Kotlin 6.3%
  • Ruby 3.7%
  • HTML 3.1%
  • Other 5.5%
0