mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-01-23 17:26:18 +01:00
28 lines
597 B
Dart
28 lines
597 B
Dart
|
import 'package:device_info_plus/device_info_plus.dart';
|
||
|
|
||
|
/// System info for Android
|
||
|
///
|
||
|
/// Only meaningful when running on Android. Must call [init] before accessing
|
||
|
/// the data fields
|
||
|
class AndroidInfo {
|
||
|
factory AndroidInfo() => _inst;
|
||
|
|
||
|
AndroidInfo._({
|
||
|
required this.sdkInt,
|
||
|
});
|
||
|
|
||
|
static Future<void> init() async {
|
||
|
final info = await DeviceInfoPlugin().androidInfo;
|
||
|
final sdkInt = info.version.sdkInt!;
|
||
|
|
||
|
_inst = AndroidInfo._(
|
||
|
sdkInt: sdkInt,
|
||
|
);
|
||
|
}
|
||
|
|
||
|
static late final AndroidInfo _inst;
|
||
|
|
||
|
/// Corresponding to Build.VERSION.SDK_INT
|
||
|
final int sdkInt;
|
||
|
}
|