has_dynamic_island 1.0.2 copy "has_dynamic_island: ^1.0.2" to clipboard
has_dynamic_island: ^1.0.2 copied to clipboard

Check if a device has the Apple dynamic island hardware

has_dynamic_island #

A Flutter package to detect the presence of Apple's Dynamic Island on iOS devices.

Features #

  • Detects whether a device has Apple's Dynamic Island or not
  • Checks using the device model as it is the most reliable way
    • Why did I make this a package instead of a simple gist: Its modular, easy to update across all my projects when the new Apple devices come out

Getting Started #

To use this package, include has_dynamic_island as a dependency in your pubspec.yaml file:

dependencies:
  has_dynamic_island: ^1.0.0

Usage #

Import the package into your Dart file:

import 'package:has_dynamic_island/has_dynamic_island.dart';

Then, you can check if the device has Apple's Dynamic Island using the hasDynamicIsland() method: If it is a non iPadOS or iOS device (AKA Android, Windows etc) it will return false

HasDynamicIsland dynamicIsland = HasDynamicIsland();
bool hasDynamicIsland = await dynamicIsland.hasDynamicIsland();
print('Device has Dynamic Island: $hasDynamicIsland');

Additional Information #

For more information, refer to the documentation.

To contribute to this package, visit the GitHub repository.

If you encounter any issues or have suggestions, please file them on the issue tracker.

License #

This package is released under the MIT License.