common/utils/random library
Classes
- BrowserProfile
- A browser identity: a User-Agent string plus the request headers a real browser of that type would send alongside it (Accept, client hints, Sec-Fetch). Keeping these consistent avoids the easy "UA claims Chrome but sends no client hints" bot tell.
Functions
-
buildBrowserHeaders(
UserAgentDevice type, {Map< String, String> explicit = const {}, String? overrideUserAgent}) → Map<String, String> -
Builds a coherent set of request headers for
type(a browser fingerprint) and overlays caller-suppliedexplicitheaders on top so they always win. -
randomBrowserProfile(
UserAgentDevice type) → BrowserProfile -
Returns a random BrowserProfile (User-Agent + matching headers) for the
given
type. -
randomUserAgent(
UserAgentDevice type) → String -
Returns a random User-Agent string for the given
type.