Skip to content

Plugin provides corner radius value of current device screen. Works for iOS and Android.

License

Notifications You must be signed in to change notification settings

ivangalkindeveloper/screen_corner_radius

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Screen Corner Radius

Plugin provides corner radius value of current device screen. Works for iOS and Android.

Pub Likes Pub Version License: MIT

Buy Me A Coffee

Demo

Usage

  1. Import the package:
import 'package:screen_corner_radius/screen_corner_radius.dart';
  1. Use the method:
final ScreenRadius? screenRadius = await ScreenCornerRadius.get();

The return value is data class ScreenRadius, which can be used immediately in the widget layout.

Android

The rounded corners API with the getRoundedCorner method is used to determine screen radii.

iOS

The UIScreen object extension with the _displayCornerRadius key parameter is used to determine screen radius.

Acknowledgments

The problem was mostly that such a plugin had not been released to Pub yet. A huge thanks to users @kylebshr and @rehmatsg for the ScreenCorners resources and the device_corner_radius package to put together the logic for iOS and Android platforms.

Additional information

For more details see example project. And feel free to open an issue if you find any bugs or errors or suggestions.

About

Plugin provides corner radius value of current device screen. Works for iOS and Android.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published