web_browser_detect 1.0.2 icon indicating copy to clipboard operation
web_browser_detect: ^1.0.2 copied to clipboard

FlutterWeb browser detection package.

web_browser_detect #

FlutterWeb browser detection package. This package helps you to detect current browser and version of the browser.

Warning: Remember that browser detection using UserAgent is never completely reliable. Therefore if you have some other way to do what you want to do, then do not use this package.

Contents #

  1. Installation
  2. How to Use
  3. Important Notes

Installation #

In your project's pubspec.yaml add:

  web_browser_detect: ^1.0.2

How to Use #

  1. If your IDE does not autoImport, add manually:
import 'package:web_browser_detect/browser.dart';
  1. Create Browser object and then you can access detected values.
import 'package:web_browser_detect/browser.dart';

main() {
  final browser = Browser();

  print('${browser.browser} ${browser.version}');

Important Notes #

Obviously this package supports only Flutter Web platform, it will not work on others. Additionally it does not support all current or past browsers, but PRs to add more are welcome.