30 changed files with 1459 additions and 0 deletions
@ -0,0 +1,32 @@
|
||||
# Miscellaneous |
||||
*.class |
||||
*.log |
||||
*.pyc |
||||
*.swp |
||||
.DS_Store |
||||
.atom/ |
||||
.buildlog/ |
||||
.history |
||||
.svn/ |
||||
migrate_working_dir/ |
||||
|
||||
# IntelliJ related |
||||
*.iml |
||||
*.ipr |
||||
*.iws |
||||
.idea/ |
||||
|
||||
# The .vscode folder contains launch configuration and tasks you configure in |
||||
# VS Code which you may wish to be included in version control, so this line |
||||
# is commented out by default. |
||||
#.vscode/ |
||||
|
||||
# Flutter/Dart/Pub related |
||||
# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. |
||||
/pubspec.lock |
||||
**/doc/api/ |
||||
.dart_tool/ |
||||
.packages |
||||
build/ |
||||
.metadata |
||||
run.sh |
@ -0,0 +1,56 @@
|
||||
# device_info_plus_aurora |
||||
|
||||
The Aurora implementation of [`device_info_plus`](https://pub.dev/packages/device_info_plus). |
||||
|
||||
Permission: `DeviceInfo` |
||||
|
||||
Information available: |
||||
|
||||
- `id` - Target platform. |
||||
- `name` - Name OS. |
||||
- `version` - Versions OS. |
||||
- `prettyName` - Name and version OS. |
||||
- `hasGNSS` - The presence of GNSS in the device. |
||||
- `hasNFC` - The presence of NFC in the device. |
||||
- `hasBluetooth` - The presence of bluetooth in the device. |
||||
- `hasWlan` - The presence of wlan in the device. |
||||
- `maxCpuClockSpeed` - Max CPU clock speed. |
||||
- `numberCpuCores` - Number CPU cores. |
||||
- `batteryChargePercentage` - Device battery charge percentage. |
||||
- `mainCameraResolution` - Device main camera resolution. |
||||
- `frontalCameraResolution` - Device frontal camera resolution. |
||||
- `ramTotalSize` - Size total ram. |
||||
- `ramFreeSize` - Size free ram. |
||||
- `screenResolution` - Device screen resolution. |
||||
- `osVersion` - Name and version OS. |
||||
- `deviceModel` - Device name model. |
||||
- `internalStorage` - Map with information on internal storage. |
||||
- `internalStorage` - Map with information on internal storage. |
||||
- `simCards` - Array with information about SIM cards. |
||||
|
||||
## Usage |
||||
This package is not an _endorsed_ implementation of `device_info_plus`. |
||||
Therefore, you have to include `device_info_plus_aurora` alongside `device_info_plus` as dependencies in your `pubspec.yaml` file. |
||||
|
||||
```yaml |
||||
dependencies: |
||||
device_info_plus: ^9.0.1 |
||||
device_info_plus_aurora: |
||||
path: # path to folder with plugin |
||||
``` |
||||
|
||||
After that you can use like this: |
||||
|
||||
```dart |
||||
import 'package:device_info_plus/device_info_plus.dart'; |
||||
|
||||
final deviceInfoPlugin = DeviceInfoPlugin(); |
||||
final deviceInfo = await deviceInfoPlugin.linuxInfo as AuroraDeviceInfo; |
||||
|
||||
debutPrint(deviceInfo.data); |
||||
``` |
||||
|
||||
### Preview example |
||||
|
||||
 |
||||
|
@ -0,0 +1 @@
|
||||
include: package:flutter_lints/flutter.yaml |
After Width: | Height: | Size: 94 KiB |
@ -0,0 +1,59 @@
|
||||
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> |
||||
<node> |
||||
<interface name="ru.omp.deviceinfo.Features"> |
||||
<signal name="cameraEnabledChanged"> |
||||
<arg name="enabled" type="b" direction="out"/> |
||||
</signal> |
||||
<method name="hasGNSS"> |
||||
<arg type="b" direction="out"/> |
||||
</method> |
||||
<method name="hasNFC"> |
||||
<arg type="b" direction="out"/> |
||||
</method> |
||||
<method name="hasBluetooth"> |
||||
<arg type="b" direction="out"/> |
||||
</method> |
||||
<method name="hasWlan"> |
||||
<arg type="b" direction="out"/> |
||||
</method> |
||||
<method name="getMaxCpuClockSpeed"> |
||||
<arg type="u" direction="out"/> |
||||
</method> |
||||
<method name="getNumberCpuCores"> |
||||
<arg type="u" direction="out"/> |
||||
</method> |
||||
<method name="getCpuModel"> |
||||
<arg type="s" direction="out"/> |
||||
</method> |
||||
<method name="getMaxCpuCoresClockSpeed"> |
||||
<arg type="av" direction="out"/> |
||||
</method> |
||||
<method name="getBatteryChargePercentage"> |
||||
<arg type="u" direction="out"/> |
||||
</method> |
||||
<method name="getMainCameraResolution"> |
||||
<arg type="d" direction="out"/> |
||||
</method> |
||||
<method name="getFrontalCameraResolution"> |
||||
<arg type="d" direction="out"/> |
||||
</method> |
||||
<method name="getRamTotalSize"> |
||||
<arg type="t" direction="out"/> |
||||
</method> |
||||
<method name="getRamFreeSize"> |
||||
<arg type="t" direction="out"/> |
||||
</method> |
||||
<method name="getScreenResolution"> |
||||
<arg type="s" direction="out"/> |
||||
</method> |
||||
<method name="getOsVersion"> |
||||
<arg type="s" direction="out"/> |
||||
</method> |
||||
<method name="getDeviceModel"> |
||||
<arg type="s" direction="out"/> |
||||
</method> |
||||
<method name="getSerialNumber"> |
||||
<arg type="s" direction="out"/> |
||||
</method> |
||||
</interface> |
||||
</node> |
@ -0,0 +1,21 @@
|
||||
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> |
||||
<node> |
||||
<interface name="ru.omp.deviceinfo.SIM"> |
||||
<signal name="simCardsEnabledChanged"> |
||||
<arg name="updatedSimCards" type="aa{sv}" direction="out"/> |
||||
<annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QVariantMapList"/> |
||||
</signal> |
||||
<signal name="preferredDataTransferSimChanged"> |
||||
<arg name="updatedSimCards" type="aa{sv}" direction="out"/> |
||||
<annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QVariantMapList"/> |
||||
</signal> |
||||
<signal name="preferredVoiceCallSimChanged"> |
||||
<arg name="updatedSimCards" type="aa{sv}" direction="out"/> |
||||
<annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QVariantMapList"/> |
||||
</signal> |
||||
<method name="getSimCardsInfo"> |
||||
<arg type="aa{sv}" direction="out"/> |
||||
<annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QVariantMapList"/> |
||||
</method> |
||||
</interface> |
||||
</node> |
@ -0,0 +1,21 @@
|
||||
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> |
||||
<node> |
||||
<interface name="ru.omp.deviceinfo.Storages"> |
||||
<signal name="externalStorageChanged"> |
||||
<arg name="updatedStorage" type="a{sv}" direction="out"/> |
||||
<annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QVariantMap"/> |
||||
</signal> |
||||
<method name="getInternalStorageInfo"> |
||||
<arg type="a{sv}" direction="out"/> |
||||
<annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QVariantMap"/> |
||||
</method> |
||||
<method name="getInternalUserPartitionInfo"> |
||||
<arg type="a{sv}" direction="out"/> |
||||
<annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QVariantMap"/> |
||||
</method> |
||||
<method name="getExternalStorageInfo"> |
||||
<arg type="a{sv}" direction="out"/> |
||||
<annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QVariantMap"/> |
||||
</method> |
||||
</interface> |
||||
</node> |
@ -0,0 +1,45 @@
|
||||
# Miscellaneous |
||||
*.class |
||||
*.log |
||||
*.pyc |
||||
*.swp |
||||
.DS_Store |
||||
.atom/ |
||||
.buildlog/ |
||||
.history |
||||
.svn/ |
||||
migrate_working_dir/ |
||||
|
||||
# IntelliJ related |
||||
*.iml |
||||
*.ipr |
||||
*.iws |
||||
.idea/ |
||||
|
||||
# The .vscode folder contains launch configuration and tasks you configure in |
||||
# VS Code which you may wish to be included in version control, so this line |
||||
# is commented out by default. |
||||
#.vscode/ |
||||
|
||||
# Flutter/Dart/Pub related |
||||
**/doc/api/ |
||||
**/ios/Flutter/.last_build_id |
||||
.dart_tool/ |
||||
.flutter-plugins |
||||
.flutter-plugins-dependencies |
||||
.packages |
||||
.pub-cache/ |
||||
.pub/ |
||||
/build/ |
||||
pubspec.lock |
||||
|
||||
# Symbolication related |
||||
app.*.symbols |
||||
|
||||
# Obfuscation related |
||||
app.*.map.json |
||||
|
||||
# Android Studio will place build artifacts here |
||||
/android/app/debug |
||||
/android/app/profile |
||||
/android/app/release |
@ -0,0 +1,17 @@
|
||||
# device_info_plus_aurora |
||||
|
||||
Demonstrates how to use the device_info_plus_aurora plugin. |
||||
|
||||
## Build |
||||
|
||||
```shell |
||||
# Add an alias if it doesn't already exist |
||||
alias flutter-aurora=$HOME/.local/opt/flutter-sdk/bin/flutter |
||||
# Get dependencies |
||||
flutter-aurora pub get |
||||
# Run build |
||||
flutter-aurora build aurora --release |
||||
``` |
||||
|
||||
You can collect, sign, run an example on the device with a script located in the `script/build_example.sh` |
||||
More information in `build_example.sh`. |
@ -0,0 +1 @@
|
||||
include: package:flutter_lints/flutter.yaml |
@ -0,0 +1 @@
|
||||
flutter/ephemeral |
@ -0,0 +1,47 @@
|
||||
cmake_minimum_required(VERSION 3.10) |
||||
project(com.example.device_info_plus_aurora_example LANGUAGES CXX) |
||||
|
||||
include(GNUInstallDirs) |
||||
|
||||
set(BINARY_NAME ${CMAKE_PROJECT_NAME}) |
||||
set(FLUTTER_DIR ${CMAKE_CURRENT_SOURCE_DIR}/flutter) |
||||
|
||||
set(CMAKE_CXX_STANDARD 17) |
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON) |
||||
|
||||
set(CMAKE_CXX_FLAGS "-Wall -Wextra") |
||||
set(CMAKE_CXX_FLAGS_RELEASE "-O3") |
||||
|
||||
set(CMAKE_SKIP_RPATH OFF) |
||||
set(CMAKE_INSTALL_RPATH "\$ORIGIN/../share/${BINARY_NAME}/lib") |
||||
|
||||
find_package(PkgConfig REQUIRED) |
||||
pkg_check_modules(FlutterEmbedder REQUIRED IMPORTED_TARGET flutter-embedder) |
||||
|
||||
add_executable(${BINARY_NAME} main.cpp ${FLUTTER_DIR}/generated_plugin_registrant.cpp) |
||||
target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::FlutterEmbedder) |
||||
target_include_directories(${BINARY_NAME} PRIVATE ${FLUTTER_DIR}) |
||||
|
||||
include(flutter/generated_plugins.cmake) |
||||
|
||||
set(PACKAGE_INSTALL_DIR ${CMAKE_INSTALL_DATADIR}/${BINARY_NAME}) |
||||
set(DESKTOP_INSTALL_DIR ${CMAKE_INSTALL_DATADIR}/applications) |
||||
set(ICONS_INSTALL_ROOT_DIR ${CMAKE_INSTALL_DATADIR}/icons/hicolor) |
||||
|
||||
add_custom_command(TARGET ${BINARY_NAME} POST_BUILD |
||||
COMMAND ${CMAKE_COMMAND} -E copy |
||||
${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/libflutter-embedder.so |
||||
${PROJECT_BINARY_DIR}/bundle/lib/libflutter-embedder.so) |
||||
|
||||
install(FILES ${PROJECT_BINARY_DIR}/bundle/icudtl.dat DESTINATION ${PACKAGE_INSTALL_DIR}) |
||||
install(DIRECTORY ${PROJECT_BINARY_DIR}/bundle/flutter_assets DESTINATION ${PACKAGE_INSTALL_DIR}) |
||||
install(DIRECTORY ${PROJECT_BINARY_DIR}/bundle/lib DESTINATION ${PACKAGE_INSTALL_DIR}) |
||||
|
||||
install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) |
||||
install(FILES desktop/${BINARY_NAME}.desktop DESTINATION ${DESKTOP_INSTALL_DIR}) |
||||
|
||||
foreach(ICONS_SIZE 86x86 108x108 128x128 172x172) |
||||
install(FILES icons/${ICONS_SIZE}.png |
||||
RENAME ${BINARY_NAME}.png |
||||
DESTINATION ${ICONS_INSTALL_ROOT_DIR}/${ICONS_SIZE}/apps/) |
||||
endforeach(ICONS_SIZE) |
@ -0,0 +1,12 @@
|
||||
[Desktop Entry] |
||||
Type=Application |
||||
Name=device_info_plus_aurora_example |
||||
Comment=Demonstrates how to use the device_info_plus_aurora plugin. |
||||
Icon=com.example.device_info_plus_aurora_example |
||||
Exec=/usr/bin/com.example.device_info_plus_aurora_example |
||||
X-Nemo-Application-Type=silica-qt5 |
||||
|
||||
[X-Application] |
||||
Permissions=DeviceInfo |
||||
OrganizationName=com.example |
||||
ApplicationName=device_info_plus_aurora_example |
@ -0,0 +1,14 @@
|
||||
//
|
||||
// Generated file. Do not edit.
|
||||
//
|
||||
|
||||
// clang-format off
|
||||
|
||||
#include <flutter/application.h> |
||||
|
||||
#include "generated_plugin_registrant.h" |
||||
|
||||
void RegisterPlugins() { |
||||
Application::RegisterPlugins({ |
||||
}); |
||||
} |
@ -0,0 +1,12 @@
|
||||
//
|
||||
// Generated file. Do not edit.
|
||||
//
|
||||
|
||||
// clang-format off
|
||||
|
||||
#ifndef GENERATED_PLUGIN_REGISTRANT |
||||
#define GENERATED_PLUGIN_REGISTRANT |
||||
|
||||
void RegisterPlugins(); |
||||
|
||||
#endif /* GENERATED_PLUGIN_REGISTRANT */ |
@ -0,0 +1,30 @@
|
||||
# |
||||
# Generated file, do not edit. |
||||
# |
||||
set(ROOT_PROJECT_BINARY_DIR "${PROJECT_BINARY_DIR}") |
||||
|
||||
function(add_library TARGET) |
||||
_add_library(${TARGET} ${ARGN}) |
||||
|
||||
if(NOT "${TARGET}" MATCHES "^PkgConfig::.*") |
||||
add_custom_command(TARGET ${TARGET} POST_BUILD |
||||
COMMAND ${CMAKE_COMMAND} -E copy |
||||
"$<TARGET_FILE:${TARGET}>" |
||||
"${ROOT_PROJECT_BINARY_DIR}/bundle/lib/$<TARGET_FILE_NAME:${TARGET}>") |
||||
endif(NOT "${TARGET}" MATCHES "^PkgConfig::.*") |
||||
endfunction() |
||||
|
||||
list(APPEND FLUTTER_PLATFORM_PLUGIN_LIST |
||||
) |
||||
|
||||
list(APPEND FLUTTER_FFI_PLUGIN_LIST |
||||
) |
||||
|
||||
foreach(PLUGIN ${FLUTTER_PLATFORM_PLUGIN_LIST}) |
||||
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${PLUGIN}/aurora plugins/${PLUGIN}) |
||||
target_link_libraries(${BINARY_NAME} PRIVATE ${PLUGIN}_platform_plugin) |
||||
endforeach(PLUGIN) |
||||
|
||||
foreach(FFI_PLUGIN ${FLUTTER_FFI_PLUGIN_LIST}) |
||||
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${FFI_PLUGIN}/aurora plugins/${FFI_PLUGIN}) |
||||
endforeach(FFI_PLUGIN) |
After Width: | Height: | Size: 9.7 KiB |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 6.5 KiB |
@ -0,0 +1,10 @@
|
||||
#include <flutter/application.h> |
||||
#include "generated_plugin_registrant.h" |
||||
|
||||
int main(int argc, char *argv[]) { |
||||
Application::Initialize(argc, argv); |
||||
Application::SetPixelRatio(1.8); |
||||
RegisterPlugins(); |
||||
Application::Launch(); |
||||
return 0; |
||||
} |
@ -0,0 +1,31 @@
|
||||
%global __provides_exclude_from ^%{_datadir}/%{name}/lib/.*$ |
||||
%global __requires_exclude ^lib(dconf|flutter-embedder|maliit-glib|appmanifest-.+|.+_platform_plugin)\\.so.*$ |
||||
|
||||
Name: com.example.device_info_plus_aurora_example |
||||
Summary: Demonstrates how to use the device_info_plus_aurora plugin. |
||||
Version: 0.1.0 |
||||
Release: 1 |
||||
License: Proprietary |
||||
Source0: %{name}-%{version}.tar.zst |
||||
|
||||
BuildRequires: cmake |
||||
BuildRequires: pkgconfig(flutter-embedder) |
||||
|
||||
%description |
||||
%{summary}. |
||||
|
||||
%prep |
||||
%autosetup |
||||
|
||||
%build |
||||
%cmake -DCMAKE_BUILD_TYPE=%{_flutter_build_type} |
||||
%make_build |
||||
|
||||
%install |
||||
%make_install |
||||
|
||||
%files |
||||
%{_bindir}/%{name} |
||||
%{_datadir}/%{name}/* |
||||
%{_datadir}/applications/%{name}.desktop |
||||
%{_datadir}/icons/hicolor/*/apps/%{name}.png |
@ -0,0 +1,385 @@
|
||||
import 'package:device_info_plus_aurora/aurora_device_info.dart'; |
||||
import 'package:flutter/material.dart'; |
||||
import 'dart:async'; |
||||
|
||||
import 'package:device_info_plus/device_info_plus.dart'; |
||||
|
||||
void main() { |
||||
runApp(const MyApp()); |
||||
} |
||||
|
||||
class MyApp extends StatefulWidget { |
||||
const MyApp({super.key}); |
||||
|
||||
@override |
||||
State<MyApp> createState() => _MyAppState(); |
||||
} |
||||
|
||||
class _MyAppState extends State<MyApp> { |
||||
String? _error; |
||||
String? _id; |
||||
String? _name; |
||||
String? _version; |
||||
String? _prettyName; |
||||
bool? _hasGNSS; |
||||
bool? _hasNFC; |
||||
bool? _hasBluetooth; |
||||
bool? _hasWlan; |
||||
int? _maxCpuClockSpeed; |
||||
int? _numberCpuCores; |
||||
int? _batteryChargePercentage; |
||||
double? _mainCameraResolution; |
||||
double? _frontalCameraResolution; |
||||
int? _ramTotalSize; |
||||
int? _ramFreeSize; |
||||
String? _screenResolution; |
||||
String? _osVersion; |
||||
String? _deviceModel; |
||||
Map<String, dynamic>? _externalStorage; |
||||
Map<String, dynamic>? _internalStorage; |
||||
List<Map<String, dynamic>>? _simCards; |
||||
|
||||
@override |
||||
void initState() { |
||||
super.initState(); |
||||
initPlatformState(); |
||||
} |
||||
|
||||
// Platform messages are asynchronous, so we initialize in an async method. |
||||
Future<void> initPlatformState() async { |
||||
final deviceInfoPlugin = DeviceInfoPlugin(); |
||||
|
||||
try { |
||||
final deviceInfo = await deviceInfoPlugin.linuxInfo as AuroraDeviceInfo; |
||||
setState(() { |
||||
_id = deviceInfo.id; |
||||
_name = deviceInfo.name; |
||||
_version = deviceInfo.version; |
||||
_prettyName = deviceInfo.prettyName; |
||||
_hasGNSS = deviceInfo.hasGNSS; |
||||
_hasNFC = deviceInfo.hasNFC; |
||||
_hasBluetooth = deviceInfo.hasBluetooth; |
||||
_hasWlan = deviceInfo.hasWlan; |
||||
_maxCpuClockSpeed = deviceInfo.maxCpuClockSpeed; |
||||
_numberCpuCores = deviceInfo.numberCpuCores; |
||||
_batteryChargePercentage = deviceInfo.batteryChargePercentage; |
||||
_mainCameraResolution = deviceInfo.mainCameraResolution; |
||||
_frontalCameraResolution = deviceInfo.frontalCameraResolution; |
||||
_ramTotalSize = deviceInfo.ramTotalSize; |
||||
_ramFreeSize = deviceInfo.ramFreeSize; |
||||
_screenResolution = deviceInfo.screenResolution; |
||||
_osVersion = deviceInfo.osVersion; |
||||
_deviceModel = deviceInfo.deviceModel; |
||||
_externalStorage = deviceInfo.externalStorage; |
||||
_internalStorage = deviceInfo.internalStorage; |
||||
_simCards = deviceInfo.simCards; |
||||
}); |
||||
} on Exception catch (e) { |
||||
setState(() { |
||||
_error = e.toString(); |
||||
}); |
||||
} |
||||
} |
||||
|
||||
@override |
||||
Widget build(BuildContext context) { |
||||
const textStyleWhite = TextStyle(fontSize: 18, color: Colors.white); |
||||
const textStyleTitle = TextStyle(fontSize: 20, color: Colors.black); |
||||
const textStylePath = TextStyle(fontSize: 18, color: Colors.black54); |
||||
|
||||
const spaceMedium = SizedBox(height: 20); |
||||
const spaceSmall = SizedBox(height: 10); |
||||
|
||||
return MaterialApp( |
||||
home: Scaffold( |
||||
appBar: AppBar( |
||||
title: const Text('Example device_info_plus'), |
||||
), |
||||
body: Stack( |
||||
children: [ |
||||
// Error message |
||||
Visibility( |
||||
visible: _error != null, |
||||
child: Center( |
||||
child: Padding( |
||||
padding: const EdgeInsets.all(16), |
||||
child: Container( |
||||
padding: const EdgeInsets.all(20), |
||||
decoration: const BoxDecoration( |
||||
color: Colors.redAccent, |
||||
borderRadius: BorderRadius.all(Radius.circular(10.0)), |
||||
), |
||||
child: Text( |
||||
_error ?? '', |
||||
style: textStyleWhite, |
||||
), |
||||
), |
||||
), |
||||
), |
||||
), |
||||
// List directories path |
||||
Visibility( |
||||
visible: _error == null, |
||||
child: SingleChildScrollView( |
||||
child: Padding( |
||||
padding: const EdgeInsets.all(16), |
||||
child: Center( |
||||
child: Column( |
||||
children: [ |
||||
// Info |
||||
Container( |
||||
padding: const EdgeInsets.all(20), |
||||
decoration: const BoxDecoration( |
||||
color: Colors.green, |
||||
borderRadius: |
||||
BorderRadius.all(Radius.circular(10.0)), |
||||
), |
||||
child: const Text( |
||||
'Demo application demonstration implementation of device_info_plus', |
||||
style: textStyleWhite, |
||||
textAlign: TextAlign.center, |
||||
), |
||||
), |
||||
const SizedBox(height: 30), |
||||
|
||||
const Text( |
||||
'ID', |
||||
style: textStyleTitle, |
||||
), |
||||
spaceSmall, |
||||
Text( |
||||
_id.toString(), |
||||
style: textStylePath, |
||||
), |
||||
|
||||
spaceMedium, |
||||
const Text( |
||||
'Name', |
||||
style: textStyleTitle, |
||||
), |
||||
spaceSmall, |
||||
Text( |
||||
_name.toString(), |
||||
style: textStylePath, |
||||
), |
||||
|
||||
spaceMedium, |
||||
const Text( |
||||
'Version', |
||||
style: textStyleTitle, |
||||
), |
||||
spaceSmall, |
||||
Text( |
||||
_version.toString(), |
||||
style: textStylePath, |
||||
), |
||||
|
||||
spaceMedium, |
||||
const Text( |
||||
'Pretty Name', |
||||
style: textStyleTitle, |
||||
), |
||||
spaceSmall, |
||||
Text( |
||||
_prettyName.toString(), |
||||
style: textStylePath, |
||||
), |
||||
|
||||
spaceMedium, |
||||
const Text( |
||||
'Has GNSS', |
||||
style: textStyleTitle, |
||||
), |
||||
spaceSmall, |
||||
Text( |
||||
_hasGNSS.toString(), |
||||
style: textStylePath, |
||||
), |
||||
|
||||
spaceMedium, |
||||
const Text( |
||||
'Has NFC', |
||||
style: textStyleTitle, |
||||
), |
||||
spaceSmall, |
||||
Text( |
||||
_hasNFC.toString(), |
||||
style: textStylePath, |
||||
), |
||||
|
||||
spaceMedium, |
||||
const Text( |
||||
'Has Bluetooth', |
||||
style: textStyleTitle, |
||||
), |
||||
spaceSmall, |
||||
Text( |
||||
_hasBluetooth.toString(), |
||||
style: textStylePath, |
||||
), |
||||
|
||||
spaceMedium, |
||||
const Text( |
||||
'Has Wlan', |
||||
style: textStyleTitle, |
||||
), |
||||
spaceSmall, |
||||
Text( |
||||
_hasWlan.toString(), |
||||
style: textStylePath, |
||||
), |
||||
|
||||
spaceMedium, |
||||
const Text( |
||||
'Max Cpu Clock Speed', |
||||
style: textStyleTitle, |
||||
), |
||||
spaceSmall, |
||||
Text( |
||||
_maxCpuClockSpeed.toString(), |
||||
style: textStylePath, |
||||
), |
||||
|
||||
spaceMedium, |
||||
const Text( |
||||
'Number Cpu Cores', |
||||
style: textStyleTitle, |
||||
), |
||||
spaceSmall, |
||||
Text( |
||||
_numberCpuCores.toString(), |
||||
style: textStylePath, |
||||
), |
||||
|
||||
spaceMedium, |
||||
const Text( |
||||
'Battery Charge Percentage', |
||||
style: textStyleTitle, |
||||
), |
||||
spaceSmall, |
||||
Text( |
||||
_batteryChargePercentage.toString(), |
||||
style: textStylePath, |
||||
), |
||||
|
||||
spaceMedium, |
||||
const Text( |
||||
'Main Camera Resolution', |
||||
style: textStyleTitle, |
||||
), |
||||
spaceSmall, |
||||
Text( |
||||
_mainCameraResolution.toString(), |
||||
style: textStylePath, |
||||
), |
||||
|
||||
spaceMedium, |
||||
const Text( |
||||
'Frontal Camera Resolution', |
||||
style: textStyleTitle, |
||||
), |
||||
spaceSmall, |
||||
Text( |
||||
_frontalCameraResolution.toString(), |
||||
style: textStylePath, |
||||
), |
||||
|
||||
spaceMedium, |
||||
const Text( |
||||
'Ram Total Size', |
||||
style: textStyleTitle, |
||||
), |
||||
spaceSmall, |
||||
Text( |
||||
_ramTotalSize.toString(), |
||||
style: textStylePath, |
||||
), |
||||
|
||||
spaceMedium, |
||||
const Text( |
||||
'Ram Free Size', |
||||
style: textStyleTitle, |
||||
), |
||||
spaceSmall, |
||||
Text( |
||||
_ramFreeSize.toString(), |
||||
style: textStylePath, |
||||
), |
||||
|
||||
spaceMedium, |
||||
const Text( |
||||
'Screen Resolution', |
||||
style: textStyleTitle, |
||||
), |
||||
spaceSmall, |
||||
Text( |
||||
_screenResolution.toString(), |
||||
style: textStylePath, |
||||
), |
||||
|
||||
spaceMedium, |
||||
const Text( |
||||
'OS Version', |
||||
style: textStyleTitle, |
||||
), |
||||
spaceSmall, |
||||
Text( |
||||
_osVersion.toString(), |
||||
style: textStylePath, |
||||
), |
||||
|
||||
spaceMedium, |
||||
const Text( |
||||
'Device Model', |
||||
style: textStyleTitle, |
||||
), |
||||
spaceSmall, |
||||
Text( |
||||
_deviceModel.toString(), |
||||
style: textStylePath, |
||||
), |
||||
|
||||
spaceMedium, |
||||
const Text( |
||||
'External Storage Info', |
||||
style: textStyleTitle, |
||||
), |
||||
spaceSmall, |
||||
Text( |
||||
_externalStorage.toString(), |
||||
style: textStylePath, |
||||
), |
||||
|
||||
spaceMedium, |
||||
const Text( |
||||
'Internal Storage Info', |
||||
style: textStyleTitle, |
||||
), |
||||
spaceSmall, |
||||
Text( |
||||
_internalStorage.toString(), |
||||
style: textStylePath, |
||||
), |
||||
|
||||
spaceMedium, |
||||
const Text( |
||||
'SIM Cards Info', |
||||
style: textStyleTitle, |
||||
), |
||||
spaceSmall, |
||||
Text( |
||||
_simCards.toString(), |
||||
style: textStylePath, |
||||
), |
||||
], |
||||
), |
||||
), |
||||
), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
), |
||||
); |
||||
} |
||||
} |
@ -0,0 +1,23 @@
|
||||
name: device_info_plus_aurora_example |
||||
description: Demonstrates how to use the device_info_plus_aurora plugin. |
||||
|
||||
publish_to: 'none' |
||||
|
||||
environment: |
||||
sdk: '>=2.18.6 <3.0.0' |
||||
|
||||
dependencies: |
||||
flutter: |
||||
sdk: flutter |
||||
device_info_plus: ^9.0.1 |
||||
device_info_plus_aurora: |
||||
path: ../ |
||||
cupertino_icons: ^1.0.2 |
||||
|
||||
dev_dependencies: |
||||
flutter_test: |
||||
sdk: flutter |
||||
flutter_lints: ^2.0.0 |
||||
|
||||
flutter: |
||||
uses-material-design: true |
@ -0,0 +1,106 @@
|
||||
import 'package:device_info_plus/device_info_plus.dart'; |
||||
|
||||
class AuroraDeviceInfo implements LinuxDeviceInfo { |
||||
/// Constructs a AuroraDeviceInfo. |
||||
AuroraDeviceInfo({ |
||||
required this.hasGNSS, |
||||
required this.hasNFC, |
||||
required this.hasBluetooth, |
||||
required this.hasWlan, |
||||
required this.maxCpuClockSpeed, |
||||
required this.numberCpuCores, |
||||
required this.batteryChargePercentage, |
||||
required this.mainCameraResolution, |
||||
required this.frontalCameraResolution, |
||||
required this.ramTotalSize, |
||||
required this.ramFreeSize, |
||||
required this.screenResolution, |
||||
required this.osVersion, |
||||
required this.deviceModel, |
||||
required this.externalStorage, |
||||
required this.internalStorage, |
||||
required this.simCards, |
||||
}); |
||||
|
||||
@override |
||||
String get id => 'aurora'; |
||||
|
||||
@override |
||||
String get name => osVersion.split(' ').first; |
||||
|
||||
@override |
||||
String? get version => osVersion.split(' ').last; |
||||
|
||||
@override |
||||
String get prettyName => osVersion; |
||||
|
||||
final bool hasGNSS; |
||||
final bool hasNFC; |
||||
final bool hasBluetooth; |
||||
final bool hasWlan; |
||||
final int maxCpuClockSpeed; |
||||
final int numberCpuCores; |
||||
final int batteryChargePercentage; |
||||
final double mainCameraResolution; |
||||
final double frontalCameraResolution; |
||||
final int ramTotalSize; |
||||
final int ramFreeSize; |
||||
final String screenResolution; |
||||
final String osVersion; |
||||
final String deviceModel; |
||||
final Map<String, dynamic> externalStorage; |
||||
final Map<String, dynamic> internalStorage; |
||||
final List<Map<String, dynamic>> simCards; |
||||
|
||||
@override |
||||
Map<String, dynamic> get data => { |
||||
'id': id, |
||||
'name': name, |
||||
'version': version, |
||||
'prettyName': prettyName, |
||||
'hasGNSS': hasGNSS, |
||||
'hasNFC': hasNFC, |
||||
'hasBluetooth': hasBluetooth, |
||||
'hasWlan': hasWlan, |
||||
'maxCpuClockSpeed': maxCpuClockSpeed, |
||||
'numberCpuCores': numberCpuCores, |
||||
'batteryChargePercentage': batteryChargePercentage, |
||||
'mainCameraResolution': mainCameraResolution, |
||||
'frontalCameraResolution': frontalCameraResolution, |
||||
'ramTotalSize': ramTotalSize, |
||||
'ramFreeSize': ramFreeSize, |
||||
'screenResolution': screenResolution, |
||||
'osVersion': osVersion, |
||||
'deviceModel': deviceModel, |
||||
'externalStorage': externalStorage, |
||||
'internalStorage': internalStorage, |
||||
'simCards': simCards, |
||||
}; |
||||
|
||||
@override |
||||
String? get buildId => null; |
||||
|
||||
@override |
||||
List<String>? get idLike => null; |
||||
|
||||
@override |
||||
String? get machineId => null; |
||||
|
||||
@override |
||||
String? get variant => null; |
||||
|
||||
@override |
||||
String? get variantId => null; |
||||
|
||||
@override |
||||
String? get versionCodename => null; |
||||
|
||||
@override |
||||
String? get versionId => null; |
||||
|
||||
@Deprecated('Use [data] getter instead') |
||||
@override |
||||
Map<String, dynamic> toMap() { |
||||
return data; |
||||
} |
||||
} |
@ -0,0 +1,94 @@
|
||||
import 'package:dbus/dbus.dart'; |
||||
import 'package:device_info_plus/device_info_plus.dart'; |
||||
import 'package:device_info_plus_aurora/ru_omp_deviceinfo_features.dart'; |
||||
import 'package:device_info_plus_aurora/ru_omp_deviceinfo_sim.dart'; |
||||
import 'package:device_info_plus_aurora/ru_omp_deviceinfo_storages.dart'; |
||||
import 'package:device_info_plus_platform_interface/device_info_plus_platform_interface.dart'; |
||||
import 'package:flutter/foundation.dart'; |
||||
import 'aurora_device_info.dart'; |
||||
|
||||
class DeviceInfoPlusAurora extends DeviceInfoPlatform { |
||||
/// Register this dart class as the platform implementation for aurora |
||||
static void registerWith() { |
||||
if (TargetPlatform.aurora == defaultTargetPlatform) { |
||||
DeviceInfoPlatform.instance = DeviceInfoPlusAurora(); |
||||
} else { |
||||
DeviceInfoPlatform.instance = DeviceInfoPlusLinuxPlugin(); |
||||
} |
||||
} |
||||
|
||||
@override |
||||
Future<BaseDeviceInfo> deviceInfo() async { |
||||
final client = DBusClient.session(); |
||||
|
||||
// Features |
||||
final features = RuOmpDeviceinfoFeatures(client, 'ru.omp.deviceinfo', |
||||
DBusObjectPath('/ru/omp/deviceinfo/Features')); |
||||
|
||||
final hasGNSS = await features.callhasGNSS(); |
||||
final hasNFC = await features.callhasNFC(); |
||||
final hasBluetooth = await features.callhasBluetooth(); |
||||
final hasWlan = await features.callhasWlan(); |
||||
final maxCpuClockSpeed = await features.callgetMaxCpuClockSpeed(); |
||||
final numberCpuCores = await features.callgetNumberCpuCores(); |
||||
final batteryChargePercentage = |
||||
await features.callgetBatteryChargePercentage(); |
||||
final mainCameraResolution = await features.callgetMainCameraResolution(); |
||||
final frontalCameraResolution = |
||||
await features.callgetFrontalCameraResolution(); |
||||
final ramTotalSize = await features.callgetRamTotalSize(); |
||||
final ramFreeSize = await features.callgetRamFreeSize(); |
||||
final screenResolution = await features.callgetScreenResolution(); |
||||
final osVersion = await features.callgetOsVersion(); |
||||
final deviceModel = await features.callgetDeviceModel(); |
||||
|
||||
// Storages |
||||
final storages = RuOmpDeviceinfoStorages(client, 'ru.omp.deviceinfo', |
||||
DBusObjectPath('/ru/omp/deviceinfo/Storages')); |
||||
|
||||
final Map<String, dynamic> internalStorage = {}; |
||||
(await storages.callgetInternalStorageInfo()).forEach((key, value) { |
||||
internalStorage[key] = value.toNative(); |
||||
}); |
||||
|
||||
final Map<String, dynamic> externalStorage = {}; |
||||
(await storages.callgetExternalStorageInfo()).forEach((key, value) { |
||||
externalStorage[key] = value.toNative(); |
||||
}); |
||||
|
||||
// SIM |
||||
final infoSIM = RuOmpDeviceinfoSIM( |
||||
client, 'ru.omp.deviceinfo', DBusObjectPath('/ru/omp/deviceinfo/SIM')); |
||||
|
||||
final List<Map<String, dynamic>> simCards = []; |
||||
for (var element in await infoSIM.callgetSimCardsInfo()) { |
||||
final Map<String, dynamic> simCard = {}; |
||||
element.forEach((key, value) { |
||||
simCard[key] = value.toNative(); |
||||
}); |
||||
simCards.add(simCard); |
||||
} |
||||
|
||||
await client.close(); |
||||
|
||||
return AuroraDeviceInfo( |
||||
hasGNSS: hasGNSS, |
||||
hasNFC: hasNFC, |
||||
hasBluetooth: hasBluetooth, |
||||
hasWlan: hasWlan, |
||||
maxCpuClockSpeed: maxCpuClockSpeed, |
||||
numberCpuCores: numberCpuCores, |
||||
batteryChargePercentage: batteryChargePercentage, |
||||
mainCameraResolution: mainCameraResolution, |
||||
frontalCameraResolution: frontalCameraResolution, |
||||
ramTotalSize: ramTotalSize, |
||||
ramFreeSize: ramFreeSize, |
||||
screenResolution: screenResolution, |
||||
osVersion: osVersion, |
||||
deviceModel: deviceModel, |
||||
externalStorage: externalStorage, |
||||
internalStorage: internalStorage, |
||||
simCards: simCards, |
||||
); |
||||
} |
||||
} |
@ -0,0 +1,237 @@
|
||||
// This file was generated using the following command and may be overwritten. |
||||
// dart-dbus generate-remote-object data/ru.omp.deviceinfo.Features.xml |
||||
|
||||
import 'package:dbus/dbus.dart'; |
||||
|
||||
/// dart-dbus generate-remote-object data/ru.omp.deviceinfo.Features.xml -o lib/ru_omp_deviceinfo_features.dart |
||||
/// Signal data for ru.omp.deviceinfo.Features.cameraEnabledChanged. |
||||
class RuOmpDeviceinfoFeaturescameraEnabledChanged extends DBusSignal { |
||||
bool get enabled => values[0].asBoolean(); |
||||
|
||||
RuOmpDeviceinfoFeaturescameraEnabledChanged(DBusSignal signal) |
||||
: super( |
||||
sender: signal.sender, |
||||
path: signal.path, |
||||
interface: signal.interface, |
||||
name: signal.name, |
||||
values: signal.values); |
||||
} |
||||
|
||||
class RuOmpDeviceinfoFeatures extends DBusRemoteObject { |
||||
/// Stream of ru.omp.deviceinfo.Features.cameraEnabledChanged signals. |
||||
late final Stream<RuOmpDeviceinfoFeaturescameraEnabledChanged> |
||||
cameraEnabledChanged; |
||||
|
||||
RuOmpDeviceinfoFeatures( |
||||
DBusClient client, String destination, DBusObjectPath path) |
||||
: super(client, name: destination, path: path) { |
||||
cameraEnabledChanged = DBusRemoteObjectSignalStream( |
||||
object: this, |
||||
interface: 'ru.omp.deviceinfo.Features', |
||||
name: 'cameraEnabledChanged', |
||||
signature: DBusSignature('b')) |
||||
.asBroadcastStream() |
||||
.map((signal) => RuOmpDeviceinfoFeaturescameraEnabledChanged(signal)); |
||||
} |
||||
|
||||
/// Invokes ru.omp.deviceinfo.Features.hasGNSS() |
||||
Future<bool> callhasGNSS( |
||||
{bool noAutoStart = false, |
||||
bool allowInteractiveAuthorization = false}) async { |
||||
var result = await callMethod('ru.omp.deviceinfo.Features', 'hasGNSS', [], |
||||
replySignature: DBusSignature('b'), |
||||
noAutoStart: noAutoStart, |
||||
allowInteractiveAuthorization: allowInteractiveAuthorization); |
||||
return result.returnValues[0].asBoolean(); |
||||
} |
||||
|
||||
/// Invokes ru.omp.deviceinfo.Features.hasNFC() |
||||
Future<bool> callhasNFC( |
||||
{bool noAutoStart = false, |
||||
bool allowInteractiveAuthorization = false}) async { |
||||
var result = await callMethod('ru.omp.deviceinfo.Features', 'hasNFC', [], |
||||
replySignature: DBusSignature('b'), |
||||
noAutoStart: noAutoStart, |
||||
allowInteractiveAuthorization: allowInteractiveAuthorization); |
||||
return result.returnValues[0].asBoolean(); |
||||
} |
||||
|
||||
/// Invokes ru.omp.deviceinfo.Features.hasBluetooth() |
||||
Future<bool> callhasBluetooth( |
||||
{bool noAutoStart = false, |
||||
bool allowInteractiveAuthorization = false}) async { |
||||
var result = await callMethod( |
||||
'ru.omp.deviceinfo.Features', 'hasBluetooth', [], |
||||
replySignature: DBusSignature('b'), |
||||
noAutoStart: noAutoStart, |
||||
allowInteractiveAuthorization: allowInteractiveAuthorization); |
||||
return result.returnValues[0].asBoolean(); |
||||
} |
||||
|
||||
/// Invokes ru.omp.deviceinfo.Features.hasWlan() |
||||
Future<bool> callhasWlan( |
||||
{bool noAutoStart = false, |
||||
bool allowInteractiveAuthorization = false}) async { |
||||
var result = await callMethod('ru.omp.deviceinfo.Features', 'hasWlan', [], |
||||
replySignature: DBusSignature('b'), |
||||
noAutoStart: noAutoStart, |
||||
allowInteractiveAuthorization: allowInteractiveAuthorization); |
||||
return result.returnValues[0].asBoolean(); |
||||
} |
||||
|
||||
/// Invokes ru.omp.deviceinfo.Features.getMaxCpuClockSpeed() |
||||
Future<int> callgetMaxCpuClockSpeed( |
||||
{bool noAutoStart = false, |
||||
bool allowInteractiveAuthorization = false}) async { |
||||
var result = await callMethod( |
||||
'ru.omp.deviceinfo.Features', 'getMaxCpuClockSpeed', [], |
||||
replySignature: DBusSignature('u'), |
||||
noAutoStart: noAutoStart, |
||||
allowInteractiveAuthorization: allowInteractiveAuthorization); |
||||
return result.returnValues[0].asUint32(); |
||||
} |
||||
|
||||
/// Invokes ru.omp.deviceinfo.Features.getNumberCpuCores() |
||||
Future<int> callgetNumberCpuCores( |
||||
{bool noAutoStart = false, |
||||
bool allowInteractiveAuthorization = false}) async { |
||||
var result = await callMethod( |
||||
'ru.omp.deviceinfo.Features', 'getNumberCpuCores', [], |
||||
replySignature: DBusSignature('u'), |
||||
noAutoStart: noAutoStart, |
||||
allowInteractiveAuthorization: allowInteractiveAuthorization); |
||||
return result.returnValues[0].asUint32(); |
||||
} |
||||
|
||||
/// Invokes ru.omp.deviceinfo.Features.getCpuModel() |
||||
Future<String> callgetCpuModel( |
||||
{bool noAutoStart = false, |
||||
bool allowInteractiveAuthorization = false}) async { |
||||
var result = await callMethod( |
||||
'ru.omp.deviceinfo.Features', 'getCpuModel', [], |
||||
replySignature: DBusSignature('s'), |
||||
noAutoStart: noAutoStart, |
||||
allowInteractiveAuthorization: allowInteractiveAuthorization); |
||||
return result.returnValues[0].asString(); |
||||
} |
||||
|
||||
/// Invokes ru.omp.deviceinfo.Features.getMaxCpuCoresClockSpeed() |
||||
Future<List<DBusValue>> callgetMaxCpuCoresClockSpeed( |
||||
{bool noAutoStart = false, |
||||
bool allowInteractiveAuthorization = false}) async { |
||||
var result = await callMethod( |
||||
'ru.omp.deviceinfo.Features', 'getMaxCpuCoresClockSpeed', [], |
||||
replySignature: DBusSignature('av'), |
||||
noAutoStart: noAutoStart, |
||||
allowInteractiveAuthorization: allowInteractiveAuthorization); |
||||
return result.returnValues[0].asVariantArray().toList(); |
||||
} |
||||
|
||||
/// Invokes ru.omp.deviceinfo.Features.getBatteryChargePercentage() |
||||
Future<int> callgetBatteryChargePercentage( |
||||
{bool noAutoStart = false, |
||||
bool allowInteractiveAuthorization = false}) async { |
||||
var result = await callMethod( |
||||
'ru.omp.deviceinfo.Features', 'getBatteryChargePercentage', [], |
||||
replySignature: DBusSignature('u'), |
||||
noAutoStart: noAutoStart, |
||||
allowInteractiveAuthorization: allowInteractiveAuthorization); |
||||
return result.returnValues[0].asUint32(); |
||||
} |
||||
|
||||
/// Invokes ru.omp.deviceinfo.Features.getMainCameraResolution() |
||||
Future<double> callgetMainCameraResolution( |
||||
{bool noAutoStart = false, |
||||
bool allowInteractiveAuthorization = false}) async { |
||||
var result = await callMethod( |
||||
'ru.omp.deviceinfo.Features', 'getMainCameraResolution', [], |
||||
replySignature: DBusSignature('d'), |
||||
noAutoStart: noAutoStart, |
||||
allowInteractiveAuthorization: allowInteractiveAuthorization); |
||||
return result.returnValues[0].asDouble(); |
||||
} |
||||
|
||||
/// Invokes ru.omp.deviceinfo.Features.getFrontalCameraResolution() |
||||
Future<double> callgetFrontalCameraResolution( |
||||
{bool noAutoStart = false, |
||||
bool allowInteractiveAuthorization = false}) async { |
||||
var result = await callMethod( |
||||
'ru.omp.deviceinfo.Features', 'getFrontalCameraResolution', [], |
||||
replySignature: DBusSignature('d'), |
||||
noAutoStart: noAutoStart, |
||||
allowInteractiveAuthorization: allowInteractiveAuthorization); |
||||
return result.returnValues[0].asDouble(); |
||||
} |
||||
|
||||
/// Invokes ru.omp.deviceinfo.Features.getRamTotalSize() |
||||
Future<int> callgetRamTotalSize( |
||||
{bool noAutoStart = false, |
||||
bool allowInteractiveAuthorization = false}) async { |
||||
var result = await callMethod( |
||||
'ru.omp.deviceinfo.Features', 'getRamTotalSize', [], |
||||
replySignature: DBusSignature('t'), |
||||
noAutoStart: noAutoStart, |
||||
allowInteractiveAuthorization: allowInteractiveAuthorization); |
||||
return result.returnValues[0].asUint64(); |
||||
} |
||||
|
||||
/// Invokes ru.omp.deviceinfo.Features.getRamFreeSize() |
||||
Future<int> callgetRamFreeSize( |
||||
{bool noAutoStart = false, |
||||
bool allowInteractiveAuthorization = false}) async { |
||||
var result = await callMethod( |
||||
'ru.omp.deviceinfo.Features', 'getRamFreeSize', [], |
||||
replySignature: DBusSignature('t'), |
||||
noAutoStart: noAutoStart, |
||||
allowInteractiveAuthorization: allowInteractiveAuthorization); |
||||
return result.returnValues[0].asUint64(); |
||||
} |
||||
|
||||
/// Invokes ru.omp.deviceinfo.Features.getScreenResolution() |
||||
Future<String> callgetScreenResolution( |
||||
{bool noAutoStart = false, |
||||
bool allowInteractiveAuthorization = false}) async { |
||||
var result = await callMethod( |
||||
'ru.omp.deviceinfo.Features', 'getScreenResolution', [], |
||||
replySignature: DBusSignature('s'), |
||||
noAutoStart: noAutoStart, |
||||
allowInteractiveAuthorization: allowInteractiveAuthorization); |
||||
return result.returnValues[0].asString(); |
||||
} |
||||
|
||||
/// Invokes ru.omp.deviceinfo.Features.getOsVersion() |
||||
Future<String> callgetOsVersion( |
||||
{bool noAutoStart = false, |
||||
bool allowInteractiveAuthorization = false}) async { |
||||
var result = await callMethod( |
||||
'ru.omp.deviceinfo.Features', 'getOsVersion', [], |
||||
replySignature: DBusSignature('s'), |
||||
noAutoStart: noAutoStart, |
||||
allowInteractiveAuthorization: allowInteractiveAuthorization); |
||||
return result.returnValues[0].asString(); |
||||
} |
||||
|
||||
/// Invokes ru.omp.deviceinfo.Features.getDeviceModel() |
||||
Future<String> callgetDeviceModel( |
||||
{bool noAutoStart = false, |
||||
bool allowInteractiveAuthorization = false}) async { |
||||
var result = await callMethod( |
||||
'ru.omp.deviceinfo.Features', 'getDeviceModel', [], |
||||
replySignature: DBusSignature('s'), |
||||
noAutoStart: noAutoStart, |
||||
allowInteractiveAuthorization: allowInteractiveAuthorization); |
||||
return result.returnValues[0].asString(); |
||||
} |
||||
|
||||
/// Invokes ru.omp.deviceinfo.Features.getSerialNumber() |
||||
Future<String> callgetSerialNumber( |
||||
{bool noAutoStart = false, |
||||
bool allowInteractiveAuthorization = false}) async { |
||||
var result = await callMethod( |
||||
'ru.omp.deviceinfo.Features', 'getSerialNumber', [], |
||||
replySignature: DBusSignature('s'), |
||||
noAutoStart: noAutoStart, |
||||
allowInteractiveAuthorization: allowInteractiveAuthorization); |
||||
return result.returnValues[0].asString(); |
||||
} |
||||
} |
@ -0,0 +1,105 @@
|
||||
// This file was generated using the following command and may be overwritten. |
||||
// dart-dbus generate-remote-object data/ru.omp.deviceinfo.SIM.xml |
||||
|
||||
import 'package:dbus/dbus.dart'; |
||||
|
||||
/// dart-dbus generate-remote-object data/ru.omp.deviceinfo.SIM.xml -o lib/ru_omp_deviceinfo_sim.dart |
||||
/// Signal data for ru.omp.deviceinfo.SIM.simCardsEnabledChanged. |
||||
class RuOmpDeviceinfoSIMsimCardsEnabledChanged extends DBusSignal { |
||||
List<Map<String, DBusValue>> get updatedSimCards => |
||||
values[0].asArray().map((child) => child.asStringVariantDict()).toList(); |
||||
|
||||
RuOmpDeviceinfoSIMsimCardsEnabledChanged(DBusSignal signal) |
||||
: super( |
||||
sender: signal.sender, |
||||
path: signal.path, |
||||
interface: signal.interface, |
||||
name: signal.name, |
||||
values: signal.values); |
||||
} |
||||
|
||||
/// Signal data for ru.omp.deviceinfo.SIM.preferredDataTransferSimChanged. |
||||
class RuOmpDeviceinfoSIMpreferredDataTransferSimChanged extends DBusSignal { |
||||
List<Map<String, DBusValue>> get updatedSimCards => |
||||
values[0].asArray().map((child) => child.asStringVariantDict()).toList(); |
||||
|
||||
RuOmpDeviceinfoSIMpreferredDataTransferSimChanged(DBusSignal signal) |
||||
: super( |
||||
sender: signal.sender, |
||||
path: signal.path, |
||||
interface: signal.interface, |
||||
name: signal.name, |
||||
values: signal.values); |
||||
} |
||||
|
||||
/// Signal data for ru.omp.deviceinfo.SIM.preferredVoiceCallSimChanged. |
||||
class RuOmpDeviceinfoSIMpreferredVoiceCallSimChanged extends DBusSignal { |
||||
List<Map<String, DBusValue>> get updatedSimCards => |
||||
values[0].asArray().map((child) => child.asStringVariantDict()).toList(); |
||||
|
||||
RuOmpDeviceinfoSIMpreferredVoiceCallSimChanged(DBusSignal signal) |
||||
: super( |
||||
sender: signal.sender, |
||||
path: signal.path, |
||||
interface: signal.interface, |
||||
name: signal.name, |
||||
values: signal.values); |
||||
} |
||||
|
||||
class RuOmpDeviceinfoSIM extends DBusRemoteObject { |
||||
/// Stream of ru.omp.deviceinfo.SIM.simCardsEnabledChanged signals. |
||||
late final Stream<RuOmpDeviceinfoSIMsimCardsEnabledChanged> |
||||
simCardsEnabledChanged; |
||||
|
||||
/// Stream of ru.omp.deviceinfo.SIM.preferredDataTransferSimChanged signals. |
||||
late final Stream<RuOmpDeviceinfoSIMpreferredDataTransferSimChanged> |
||||
preferredDataTransferSimChanged; |
||||
|
||||
/// Stream of ru.omp.deviceinfo.SIM.preferredVoiceCallSimChanged signals. |
||||
late final Stream<RuOmpDeviceinfoSIMpreferredVoiceCallSimChanged> |
||||
preferredVoiceCallSimChanged; |
||||
|
||||
RuOmpDeviceinfoSIM(DBusClient client, String destination, DBusObjectPath path) |
||||
: super(client, name: destination, path: path) { |
||||
simCardsEnabledChanged = DBusRemoteObjectSignalStream( |
||||
object: this, |
||||
interface: 'ru.omp.deviceinfo.SIM', |
||||
name: 'simCardsEnabledChanged', |
||||
signature: DBusSignature('aa{sv}')) |
||||
.asBroadcastStream() |
||||
.map((signal) => RuOmpDeviceinfoSIMsimCardsEnabledChanged(signal)); |
||||
|
||||
preferredDataTransferSimChanged = DBusRemoteObjectSignalStream( |
||||
object: this, |
||||
interface: 'ru.omp.deviceinfo.SIM', |
||||
name: 'preferredDataTransferSimChanged', |
||||
signature: DBusSignature('aa{sv}')) |
||||
.asBroadcastStream() |
||||
.map((signal) => |
||||
RuOmpDeviceinfoSIMpreferredDataTransferSimChanged(signal)); |
||||
|
||||
preferredVoiceCallSimChanged = DBusRemoteObjectSignalStream( |
||||
object: this, |
||||
interface: 'ru.omp.deviceinfo.SIM', |
||||
name: 'preferredVoiceCallSimChanged', |
||||
signature: DBusSignature('aa{sv}')) |
||||
.asBroadcastStream() |
||||
.map( |
||||
(signal) => RuOmpDeviceinfoSIMpreferredVoiceCallSimChanged(signal)); |
||||
} |
||||
|
||||
/// Invokes ru.omp.deviceinfo.SIM.getSimCardsInfo() |
||||
Future<List<Map<String, DBusValue>>> callgetSimCardsInfo( |
||||
{bool noAutoStart = false, |
||||
bool allowInteractiveAuthorization = false}) async { |
||||
var result = await callMethod( |
||||
'ru.omp.deviceinfo.SIM', 'getSimCardsInfo', [], |
||||
replySignature: DBusSignature('aa{sv}'), |
||||
noAutoStart: noAutoStart, |
||||
allowInteractiveAuthorization: allowInteractiveAuthorization); |
||||
return result.returnValues[0] |
||||
.asArray() |
||||
.map((child) => child.asStringVariantDict()) |
||||
.toList(); |
||||
} |
||||
} |
@ -0,0 +1,72 @@
|
||||
// This file was generated using the following command and may be overwritten. |
||||
// dart-dbus generate-remote-object data/ru.omp.deviceinfo.Storages.xml |
||||
|
||||
import 'package:dbus/dbus.dart'; |
||||
|
||||
/// dart-dbus generate-remote-object data/ru.omp.deviceinfo.Storages.xml -o lib/ru_omp_deviceinfo_storages.dart |
||||
/// Signal data for ru.omp.deviceinfo.Storages.externalStorageChanged. |
||||
class RuOmpDeviceinfoStoragesexternalStorageChanged extends DBusSignal { |
||||
Map<String, DBusValue> get updatedStorage => values[0].asStringVariantDict(); |
||||
|
||||
RuOmpDeviceinfoStoragesexternalStorageChanged(DBusSignal signal) |
||||
: super( |
||||
sender: signal.sender, |
||||
path: signal.path, |
||||
interface: signal.interface, |
||||
name: signal.name, |
||||
values: signal.values); |
||||
} |
||||
|
||||
class RuOmpDeviceinfoStorages extends DBusRemoteObject { |
||||
/// Stream of ru.omp.deviceinfo.Storages.externalStorageChanged signals. |
||||
late final Stream<RuOmpDeviceinfoStoragesexternalStorageChanged> |
||||
externalStorageChanged; |
||||
|
||||
RuOmpDeviceinfoStorages( |
||||
DBusClient client, String destination, DBusObjectPath path) |
||||
: super(client, name: destination, path: path) { |
||||
externalStorageChanged = DBusRemoteObjectSignalStream( |
||||
object: this, |
||||
interface: 'ru.omp.deviceinfo.Storages', |
||||
name: 'externalStorageChanged', |
||||
signature: DBusSignature('a{sv}')) |
||||
.asBroadcastStream() |
||||
.map((signal) => RuOmpDeviceinfoStoragesexternalStorageChanged(signal)); |
||||
} |
||||
|
||||
/// Invokes ru.omp.deviceinfo.Storages.getInternalStorageInfo() |
||||
Future<Map<String, DBusValue>> callgetInternalStorageInfo( |
||||
{bool noAutoStart = false, |
||||
bool allowInteractiveAuthorization = false}) async { |
||||
var result = await callMethod( |
||||
'ru.omp.deviceinfo.Storages', 'getInternalStorageInfo', [], |
||||
replySignature: DBusSignature('a{sv}'), |
||||
noAutoStart: noAutoStart, |
||||
allowInteractiveAuthorization: allowInteractiveAuthorization); |
||||
return result.returnValues[0].asStringVariantDict(); |
||||
} |
||||
|
||||
/// Invokes ru.omp.deviceinfo.Storages.getInternalUserPartitionInfo() |
||||
Future<Map<String, DBusValue>> callgetInternalUserPartitionInfo( |
||||
{bool noAutoStart = false, |
||||
bool allowInteractiveAuthorization = false}) async { |
||||
var result = await callMethod( |
||||
'ru.omp.deviceinfo.Storages', 'getInternalUserPartitionInfo', [], |
||||
replySignature: DBusSignature('a{sv}'), |
||||
noAutoStart: noAutoStart, |
||||
allowInteractiveAuthorization: allowInteractiveAuthorization); |
||||
return result.returnValues[0].asStringVariantDict(); |
||||
} |
||||
|
||||
/// Invokes ru.omp.deviceinfo.Storages.getExternalStorageInfo() |
||||
Future<Map<String, DBusValue>> callgetExternalStorageInfo( |
||||
{bool noAutoStart = false, |
||||
bool allowInteractiveAuthorization = false}) async { |
||||
var result = await callMethod( |
||||
'ru.omp.deviceinfo.Storages', 'getExternalStorageInfo', [], |
||||
replySignature: DBusSignature('a{sv}'), |
||||
noAutoStart: noAutoStart, |
||||
allowInteractiveAuthorization: allowInteractiveAuthorization); |
||||
return result.returnValues[0].asStringVariantDict(); |
||||
} |
||||
} |
@ -0,0 +1,27 @@
|
||||
name: device_info_plus_aurora |
||||
description: The Aurora OS implementation of flutter_local_notifications. |
||||
version: 0.0.1 |
||||
homepage: |
||||
|
||||
environment: |
||||
sdk: '>=2.18.6 <3.0.0' |
||||
flutter: ">=2.5.0" |
||||
|
||||
dependencies: |
||||
flutter: |
||||
sdk: flutter |
||||
dbus: ^0.7.8 |
||||
device_info_plus: ^9.0.1 |
||||
plugin_platform_interface: ^2.0.2 |
||||
device_info_plus_platform_interface: ^7.0.0 |
||||
|
||||
dev_dependencies: |
||||
flutter_test: |
||||
sdk: flutter |
||||
flutter_lints: ^2.0.0 |
||||
|
||||
flutter: |
||||
plugin: |
||||
platforms: |
||||
aurora: |
||||
dartPluginClass: DeviceInfoPlusAurora |
Loading…
Reference in new issue