Skip to content
pubscout

ua_client_hints

1.7.0, released 7 months ago by wasabeef.jp

Provide User-Agent Client Hints to Flutter for Android, iOS, macOS, and Web.

$ flutter pub add ua_client_hints
Source repository

What it does

It provides APIs to retrieve User-Agent strings, UserAgentData, and HTTP headers containing User-Agent Client Hints. It supports Android, iOS, macOS, and Web platforms.

AI-written summary of version 1.7.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to send User-Agent Client Hints in your HTTP request headers.
  • You want to read detailed device and platform information like architecture, model, and platform version.

Skip it when

  • You do not need HTTP User-Agent headers or device metadata.
  • You are targeting unsupported platforms.

Strengths

  • Supports multiple platforms including Android, iOS, macOS, and Web.
  • Provides convenient helper functions for popular networking libraries like Dio.
  • Implements null safety.

Weaknesses

  • On Web, some high-entropy hints may be empty depending on browser support.

Setup

Kind
Plugin (native code)
Effort
Low
Code generation
No
Direct dependencies
0

Add to pubspec.yaml via 'flutter pub add ua_client_hints'.

final String ua = await userAgent();
print('User-Agent: $ua');

Alternatives

Packages that do the same job and could replace ua_client_hints.

Works with

Packages commonly used together with ua_client_hints: ones it builds on, ones built on it, and its own family.