0 purchases
detail
device_platform_info #
Plugin to read device properties such Device model or brand,Your app version code/build code, Your device public IP
Getting Started #
This project is a starting point for a Flutter
plug-in package,
a specialized package that includes platform-specific implementation code for
Android and/or iOS.
For help getting started with Flutter development, view the
online documentation, which offers tutorials,
samples, guidance on mobile development, and a full API reference.
Example #
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:device_platform_info/device_platform_info.dart';
void main() {
runApp(const DeviceInfoExample());
}
class DeviceInfoExample extends StatelessWidget {
const DeviceInfoExample({Key? key}) : super(key: key);
void Function()? getDeviceInfo() {
return () async {
/// Initialize Plugin
final devicePropertiesPlugin = DeviceDetail();
try {
/// get all devices info
var deviceInfo = await devicePropertiesPlugin.getDeviceInfo();
print("your devices info detail :\n${deviceInfo?.toJson()}");
/// only get your public ip
var ipPublic = await devicePropertiesPlugin.getPublicIp();
print("your devices ip public detail :\n$ipPublic");
// /// only get your device UUID
var uuid = await devicePropertiesPlugin.getUUID();
print("uuid device :\n$uuid");
} on PlatformException {
/// Handle Error
return;
}
};
}
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
appBar: AppBar(title: const Text("DeviceInfoExample")),
body: Center(
child:
ElevatedButton(onPressed: getDeviceInfo(), child: const Text("Get devices Info")),
)),
);
}
}
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.