Search packages, repositories and app categories

data_usage cover
Package detailsv1.0.3

data_usage

A Flutter plugin to fetch data usage on mobile devices

AndroidiOS
30-day downloads
65
Likes
22
Pub points
120

Install package

flutter pub add data_usage

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

The data_usage package is a Flutter plugin that enables developers to retrieve real-time data usage statistics on Android and iOS devices. It provides access to cellular and Wi-Fi data consumption, helping users monitor their network usage. Designed for cross-platform compatibility, it integrates seamlessly into Flutter applications with minimal setup. The plugin leverages native device APIs to ensure accurate data collection and is ideal for apps focused on network management, billing, or user awareness. Its lightweight design ensures efficient performance without impacting app responsiveness.

Use cases

  • Monitoring mobile data consumption
  • Building network usage dashboards
  • Integrating data alerts in apps
  • Supporting billing or quota systems
  • Creating network health monitoring tools

Key features

  • Cross-platform support (Android & iOS)
  • Real-time data usage retrieval
  • Minimal setup and integration
  • Accurate native API access
  • Lightweight and performant

Suitable for

  • Network monitoring apps
  • Mobile utility tools
  • Billing and quota tracking
  • User-facing data dashboards
  • Developer tools for network analysis

Considerations

  • Requires appropriate permissions on both platforms
  • Data accuracy may vary by device manufacturer
  • Limited to basic data usage metrics
  • May require background execution permissions
  • Not available on web or desktop platforms

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

Data Usage

Data Usage gets Mobile/Wifi data usage values from mobile devices, on android it will fetch the data per app but due to current limitations on ios it can only give the total/complete values of overall data used.

Screen Shots

Usage for Android

  • Initialize plugin and requests for permission
  • Request Data usage stats
  DataUsageModel.init() // Only Required for Android
  List<DataUsageModel> dataUsage = await DataUsage.dataUsageAndroid(
     withAppIcon: true, // if false `DataUsageModel.appIconBytes` will be null
     dataUsageType: DataUsageType.wifi, // DataUsageType.wifi | DataUsageType.mobile
     oldVersion: false // will be true for Android versions lower than 23 (MARSHMELLOW)
   );

This would return:

   [   ...,
      DataUsageModel({
            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

  IOSDataUsageModel dataUsage = await DataUsage.dataUsageIOS();

This would return:

  IOSDataUsageModel({
     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
  });

Contribution

Lots of PR's would be needed to make this plugin standard, as for iOS there's a permanent limitation for getting the exact data usage, there's only one way arount it and it's super complex.

Categories

Source repository

Projects using this package

No data available yet.