FLUTTER ECOSYSTEM

device_region

This plugin uses platform-specific API to return SIM country code

Latest version
1.4.0
30-day downloads
60.5K
Likes
26
Pub points
150

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

Overview

The device_region package retrieves the SIM country code using platform-specific APIs on Android, iOS, Windows, and Linux. It provides a simple, cross-platform way to determine the country associated with the device's SIM card, which is useful for localization, region-based content delivery, or compliance checks. The plugin abstracts native implementation details, offering a consistent Dart interface across platforms. It does not require internet access and operates directly from device-level data.

Use cases
  • Determining user's country based on SIM card
  • Localizing app content by region
  • Enforcing region-specific restrictions
  • Automatically setting default country in forms
  • Supporting multi-region applications
Key features
  • Cross-platform support (Android, iOS, Windows, Linux)
  • Uses native SIM country code APIs
  • No internet required
  • Simple, lightweight API
  • Returns ISO 3166-1 alpha-2 country codes
Suitable for
  • Apps needing regional detection without GPS
  • Travel or payment apps requiring country context
  • Localization frameworks
  • Offline-first applications
  • Developers targeting multiple platforms
Considerations
  • Relies on SIM card presence; may return null if no SIM
  • Does not work on devices without SIM (e.g., tablets)
  • Country code may not reflect user's current location
  • Limited to SIM-based country identification
  • May require runtime permissions on some platforms
Supported platformsAndroidiOSWindowsLinux

Install package

flutter pub add device_region

Categories

Source repository

Related projects