network_usage

Creator: coderz1093

Last updated:

Add to Cart

Description:

network usage

network_usage #
Data Usage is currently under maintained.
This a refactored lib for Data Usage
Getting Started #

This package fix the following error when building Android
Class 'DataUsagePlugin' is not abstract and does not implement abstract member public abstract fun onRequestPermissionsResult(p0: Int, p1: Array<(out) String!>, p2: IntArray): Boolean defined in io.flutter.plugin.common.PluginRegistry.RequestPermissionsResultListener

copied to clipboard


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)
);
copied to clipboard


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
})
]
copied to clipboard
For more explanation
Usage for iOS #
Request for Total data usage on iOS devices
IOSNetworkUsageModel networkIOSUsage = await MethodChannelNetworkUsage.networkUsageIOS();

copied to clipboard
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
});
copied to clipboard

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files:

Customer Reviews

There are no reviews.