platform/packages/user_agent/user_agent
2021-06-21 13:43:02 +08:00
..
example Published user_agent 2021-06-21 12:43:13 +08:00
lib Updated user_agent 2021-06-21 13:43:02 +08:00
test Published user_agent 2021-06-21 12:43:13 +08:00
.gitignore Merged from sdk-2.12.x_nnbd 2021-06-20 20:37:20 +08:00
.travis.yml Merged from sdk-2.12.x_nnbd 2021-06-20 20:37:20 +08:00
analysis_options.yaml Merged from sdk-2.12.x_nnbd 2021-06-20 20:37:20 +08:00
AUTHORS.md Merged from sdk-2.12.x_nnbd 2021-06-20 20:37:20 +08:00
CHANGELOG.md Updated user_agent 2021-06-21 13:43:02 +08:00
LICENSE Merged from sdk-2.12.x_nnbd 2021-06-20 20:37:20 +08:00
LICENSE.orig Merged from sdk-2.12.x_nnbd 2021-06-20 20:37:20 +08:00
pubspec.yaml Updated user_agent 2021-06-21 13:43:02 +08:00
README.md Updated user_agent 2021-06-21 13:43:02 +08:00

User Agent Analyzer

version Null Safety Gitter

License

Forked from user_agent to support NNBD

A library to identify the type of devices and web browsers based on User-Agent string.

Runs anywhere.

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

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