FLUTTER ECOSYSTEM

platform_detect

A lightweight library for detecting the running browser and OS

Latest version
2.1.6
30-day downloads
97.8K
Likes
38
Pub points
125

Package Overview

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

Overview

platform_detect is a lightweight Flutter Web library designed to identify the current operating system and browser environment at runtime. It provides simple, reliable detection of platform details such as OS (e.g., Windows, macOS, Linux) and browser (e.g., Chrome, Safari, Firefox), enabling developers to tailor behavior or UI based on the user's environment. The package is optimized for web applications and integrates seamlessly with Flutter’s web platform. It relies on client-side JavaScript detection without external dependencies.

Use cases
  • Adapting UI layout for different browsers
  • Conditionally enabling features based on OS
  • Debugging platform-specific issues
  • Optimizing performance per browser
  • Handling browser compatibility quirks
Key features
  • Lightweight and fast
  • No external dependencies
  • Supports major browsers and OSes
  • Simple API with clear results
  • Built specifically for Flutter Web
Suitable for
  • Web-only Flutter apps
  • Cross-browser compatibility logic
  • Environment-aware UI rendering
  • Developer tools and diagnostics
Considerations
  • Limited to web platforms only
  • Relies on browser/user agent strings
  • May require updates for new browser versions
  • Not suitable for mobile or desktop apps
Supported platformsWeb

Install package

flutter pub add platform_detect

Categories

Dependencies

Dependency list 2 items

Source repository

Related projects

No data available yet.