device_info_gigachad 0.3.0 copy "device_info_gigachad: ^0.3.0" to clipboard
device_info_gigachad: ^0.3.0 copied to clipboard

This plugin will let you get device information synchronously via ffi.

device_info_gigachad #

This plugin will let you get device information synchronously via ffi.


gigachad

Platform support #

Android iOS Windows macOS Linux Web

Preparation before use #

Android #

If native code obfuscation is enabled in Android part of your project (in android/app/build.gradle(.kts) isMinifyEnabled is set to true) you should add this rules in your proguard-rules.pro file otherwise you will get an java.lang.ClassNotFoundException in runtime.

-keep class com.mozochek.device_info_gigachad.DeviceInfoGigachad { *; }
-keep class com.mozochek.device_info_gigachad.DeviceInfoGigachad$Companion { *; }

See example for more information.

iOS #

Make sure your app meets the requirements if you want to use UIDevice.current.name. For more information: https://developer.apple.com/documentation/uikit/uidevice/name


Basic usage #

import 'package:device_info_gigachad/device_info_gigachad.dart';

void someFunc() {
  final deviceInfo = DeviceInfoGigachad.getInfo();
  switch (deviceInfo) {
    case AndroidDeviceInfo():
      print(deviceInfo.version.sdkInt);
      // your desired code with AndroidDeviceInfo instance
      break;
    case IosDeviceInfo():
      print(deviceInfo.uiDevice.systemVersion);
      // your desired code with IosDeviceInfo instance
      break;
  }
}

1
likes
160
points
114
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

This plugin will let you get device information synchronously via ffi.

Repository (GitHub)
View/report issues

Topics

#device #info #gigachad

License

BSD-3-Clause (license)

Dependencies

ffi, flutter, jni

More

Packages that depend on device_info_gigachad

Packages that implement device_info_gigachad