network_usage 0.0.3 copy "network_usage: ^0.0.3" to clipboard
network_usage: ^0.0.3 copied to clipboard

PlatformAndroidiOS
outdated

A Refactored data_usage plugin to fetch network usage on mobile devices.

network_usage #

Data Usage is currently under maintained. This a refactored lib for Data Usage

Getting Started #

Usage for Android #

  • Initialize plugin and requests for permission

  • Request Data usage stats

      NetworkUsageModel.init() // Only Required for Android
      List<NetworkUsageModel> networkUsage = await MethodChannelNetworkUsage.networkUsageAndroid(
           withAppIcon: true,
           dataUsageType: NetworkUsageType.wifi,
           oldVersion: false // will be true for Android versions lower than 23 (MARSHMELLOW)
         );
    

This would return:

   [   ...,
       NetworkUsageModel({
            String appName; //App's Name
            String packageName; // App's package name
            Uint8List appIconBytes; // Icon in bytes
            int received; // Amount of data Received
            int sent; // Amount of data sent/transferred
      })
   ]

For more explanation

Usage for iOS #

Request for Total data usage on iOS devices

  IOSNetworkUsageModel  networkIOSUsage = await MethodChannelNetworkUsage.networkUsageIOS();

This would return:

  IOSNetworkUsageModel({
     int wifiCompelete, // Total Amount of wifi data (received + sent)
     int wifiReceived, // Amount of wifi data Received
     int wifiSent, // Amount of data sent/transferred
     int wwanCompelete, // Total Amount of mobile data (received + sent)
     int wwanReceived, // Amount of mobile data Received
     int wwanSent // Amount of data sent/transferred
  });
7
likes
140
points
131
downloads

Publisher

unverified uploader

Weekly Downloads

A Refactored data_usage plugin to fetch network usage on mobile devices.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on network_usage

Packages that implement network_usage