user_agent 1.0.0-beta

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 59

user_agent

Dart user agent detection library. Uses the code from both dart:html and package:r2d2.

Runs anywhere.

main() async {
    app.before.add('*', (req, res) async {
        var ua = new UserAgent(req.headers.value('user-agent'));

        if (ua.isChrome) {
            res.redirect('/upgrade-your-browser');
            return;
        } else {
            // ...
        }
    });
}

Changelog

0.0.1

  • Initial version, created by Stagehand

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  user_agent: "^1.0.0-beta"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:user_agent/user_agent.dart';
        
Version Uploaded Documentation Archive
1.0.0-beta Jan 14, 2017 Go to the documentation of user_agent 1.0.0-beta Download user_agent 1.0.0-beta archive

Analysis

This feature is new.
We welcome feedback.
More details: scoring.

We analyzed this package, and provided a score, details, and suggestions below.

  • completed on Feb 3, 2018
  • Dart: 2.0.0-dev.20.0
  • pana: 0.10.1

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
21 / 100
Health:
Code health derived from static analysis. [more]
100 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
93 / 100
Overall score:
Weighted score of the above. [more]
59

Platforms

Detected platforms: Flutter, other

Primary library: package:user_agent/user_agent.dart with components: io.

Suggestions

  • Fix .analysis_options.

    We were unable to parse .analysis_options.

  • Package is pre-release.

    Pre-release versions should be used with caution, their API may change in breaking ways.

  • The description is too short.

    Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

  • Maintain an example.

    Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use user_agent.dart.

  • Use analysis_options.yaml.

    Rename old .analysis_options file to analysis_options.yaml.

  • Enable strong mode analysis.

    Strong mode helps you to detect bugs and potential issues earlier.Start your analysis_options.yaml file with the following:

    analyzer:
      strong-mode: true
    

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.0.0 <2.0.0
r2d2 >=0.1.1 <0.2.0 0.1.1
Transitive dependencies
async 2.0.3
charcode 1.1.1
collection 1.14.5
http 0.11.3+16
http_parser 3.1.1
http_server 0.9.7
logging 0.11.3+1
mime 0.9.6
path 1.5.1
source_span 1.4.0
string_scanner 1.0.2
typed_data 1.1.5
Dev dependencies
test >=0.12.0 <0.13.0