user_agent

A Dart user agent detection library.


License
BSD-2-Clause

Documentation

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 {
            // ...
        }
    });
}