iws_device_info 1.4.0
iws_device_info: ^1.4.0 copied to clipboard
A package that provides information about the device with IWS format.
example/main.dart
import 'package:flutter/material.dart';
import 'package:iws_device_info/iws_device_info.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
// Retrieve device information
final myDevice = await IwsDeviceInfo.getDeviceInfo(
deviceId: '123456789', userIdentifier: "customerId");
runApp(MyApp(device: myDevice));
}
class MyApp extends StatelessWidget {
final AppDevice device;
const MyApp({super.key, required this.device});
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Flutter Demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
home: MyHomePage(title: 'Flutter Demo Home Page', device: device),
);
}
}
class MyHomePage extends StatefulWidget {
final AppDevice device;
const MyHomePage({super.key, required this.title, required this.device});
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: Text(widget.title),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
const SizedBox(height: 20),
Text(widget.device.id ?? ''),
],
),
),
);
}
}