iws_device_info 1.4.0 copy "iws_device_info: ^1.4.0" to clipboard
iws_device_info: ^1.4.0 copied to clipboard

A package that provides information about the device with IWS format.

IWS Device Info #

A Flutter package that provides detailed device information in an IWS (Integrated Web Services) compatible format. This package facilitates obtaining device data such as platform, model, brand, operating system, and more.

Key Features #

  • 🚀 Quick and easy implementation - Integration in minutes
  • 📱 Cross-platform support - Compatible with Android, iOS, Web, Windows, macOS, and Linux
  • 🔧 IWS compatible format - Standardized data structure
  • 📊 Complete device information - ID, fingerprint, brand, model, OS, and more
  • Platform detection - Useful methods to identify device type

Installation #

Add this package to your Flutter project:

flutter pub add iws_device_info

Or add it manually to your pubspec.yaml:

dependencies:
  iws_device_info: ^1.3.1

Basic Usage #

Import the package #

import 'package:iws_device_info/iws_device_info.dart';

Get complete device information #

// Get complete device information
final device = await IwsDeviceInfo.getDeviceInfo(
  deviceId: 'unique-device-id',           // Unique device ID (optional)
  userIdentifier: 'user-identifier-123', // User identifier (optional)
);

// Access device information
print('Device ID: ${device.id}');
print('Brand: ${device.brand}');
print('Model: ${device.model}');
print('Operating System: ${device.os}');
print('Platform: ${device.platformName?.name}');
print('Fingerprint: ${device.fingerprint}');

// Convert to JSON for API sending
final deviceJson = device.toJson();

Platform detection #

// Get platform name
final platformName = IwsDeviceInfo.getDevicePlatformName();
print('Current platform: ${platformName?.name}');

// Check device type
final isMobile = IwsDeviceInfo.isMobile();           // Android or iOS
final isWebOrDesktop = IwsDeviceInfo.isWebOrDesktop(); // Web, Windows, macOS, or Linux

// Check specific platforms
final isWeb = IwsDeviceInfo.isWeb();
final isAndroid = IwsDeviceInfo.isAndroid();
final isIOS = IwsDeviceInfo.isIOS();
final isWindows = IwsDeviceInfo.isWindows();
final isLinux = IwsDeviceInfo.isLinux();
final isMacOS = IwsDeviceInfo.isMacOS();

// Check if it's an Apple device
final isAppleDevice = IwsDeviceInfo.isAppleDevice(); // iOS or macOS

Get platform by name #

// Convert string to PlatformName enum
final platform = IwsDeviceInfo.getPlatformByName('Android');
if (platform != null) {
  print('Platform found: ${platform.name}');
}

Complete Example #

import 'package:flutter/material.dart';
import 'package:iws_device_info/iws_device_info.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  
  // Get device information
  final device = await IwsDeviceInfo.getDeviceInfo(
    deviceId: 'device-123',
    userIdentifier: 'user-456',
  );
  
  runApp(MyApp(device: device));
}

class MyApp extends StatelessWidget {
  final AppDevice device;
  
  const MyApp({Key? key, required this.device}) : super(key: key);
  
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: DeviceInfoScreen(device: device),
    );
  }
}

class DeviceInfoScreen extends StatelessWidget {
  final AppDevice device;
  
  const DeviceInfoScreen({Key? key, required this.device}) : super(key: key);
  
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('Device Information')),
      body: Padding(
        padding: const EdgeInsets.all(16.0),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            Text('Platform: ${device.platformName?.name ?? 'Unknown'}'),
            Text('Brand: ${device.brand ?? 'N/A'}'),
            Text('Model: ${device.model ?? 'N/A'}'),
            Text('Operating System: ${device.os ?? 'N/A'}'),
            Text('ID: ${device.id ?? 'N/A'}'),
            const SizedBox(height: 20),
            Text('Is Mobile: ${IwsDeviceInfo.isMobile()}'),
            Text('Is Web: ${IwsDeviceInfo.isWeb()}'),
            Text('Is Apple Device: ${IwsDeviceInfo.isAppleDevice()}'),
          ],
        ),
      ),
    );
  }
}

Data Models #

The package includes the following models:

AppDevice #

class AppDevice {
  String? id;              // Unique device ID
  String? fingerprint;     // Device fingerprint
  String? brand;           // Device brand
  String? model;           // Device model
  String? name;            // Device name
  String? os;              // Operating system
  String? userIdentifier;  // User identifier
  PlatformName? platformName; // Platform name
  
  // Convert to JSON for APIs
  Map<String, dynamic> toJson();
}

PlatformName (Enum) #

enum PlatformName {
  web('Web'),
  android('Android'),
  ios('iOS'),
  macos('macOS'),
  windows('Windows'),
  linux('Linux');
}

Supported Platforms #

Platform ✅ Supported Available Information
Android Brand, model, OS version, fingerprint
iOS Model, OS version, fingerprint
Web Browser information
Windows System information
macOS System information
Linux System information
0
likes
150
points
20
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A package that provides information about the device with IWS format.

Homepage

License

MIT (license)

Dependencies

device_info_plus, flutter

More

Packages that depend on iws_device_info