platform-common-utilities/packages/user_agent
thomashii@dukefirehawk.com e52eb8a811 Upgraded to support sdk 2.17
2022-07-06 22:04:09 +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
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 Upgraded to support sdk 2.17 2022-07-06 22:04:09 +08:00
LICENSE Added range_header, user_agent and body_parser 2021-09-12 09:23:12 +08:00
melos_user_agent_analyzer.iml Upgraded to support sdk 2.17 2022-07-06 22:04:09 +08:00
pubspec.yaml Upgraded to support sdk 2.17 2022-07-06 22:04:09 +08:00
README.md Added pretty_logging and json_serializer 2021-09-16 11:23:05 +08:00

User Agent Analyzer

Pub Version (including pre-releases) 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 {
            // ...
        }
    });
}