platform-common-utilities/packages/user_agent
2021-09-12 09:23:12 +08:00
..
example Added range_header, user_agent and body_parser 2021-09-12 09:23:12 +08:00
lib Added range_header, user_agent and body_parser 2021-09-12 09:23:12 +08:00
test Added range_header, user_agent and body_parser 2021-09-12 09:23:12 +08:00
.travis.yml Added range_header, user_agent and body_parser 2021-09-12 09:23:12 +08:00
analysis_options.yaml Added range_header, user_agent and body_parser 2021-09-12 09:23:12 +08:00
AUTHORS.md Added range_header, user_agent and body_parser 2021-09-12 09:23:12 +08:00
CHANGELOG.md Added range_header, user_agent and body_parser 2021-09-12 09:23:12 +08:00
LICENSE Added range_header, user_agent and body_parser 2021-09-12 09:23:12 +08:00
pubspec.yaml Added range_header, user_agent and body_parser 2021-09-12 09:23:12 +08:00
README.md Added range_header, user_agent and body_parser 2021-09-12 09:23:12 +08:00

User Agent Analyzer

version Null Safety License

Replacement of package:user_agent with breaking changes 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 {
            // ...
        }
    });
}