user_agent 2.0.0 copy "user_agent: ^2.0.0" to clipboard
user_agent: ^2.0.0 copied to clipboard

A Dart user agent detection library.

user_agent #

Simple Dart user agent detection library.

Runs anywhere.

Incorporates some code from the old package:r2d2.

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

        if (ua.isChrome) {
            res.redirect('/upgrade-your-browser');
            return;
        } else {
            // ...
        }
    });
}
3
likes
30
pub points
30%
popularity

Publisher

unverified uploader

A Dart user agent detection library.

Repository (GitHub)
View/report issues

License

BSD-2-Clause (LICENSE)

More

Packages that depend on user_agent