platform-common-utilities/packages/user_agent
2024-05-21 23:51:17 +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 Updated Changelog 2024-05-21 23:51:17 +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 Updated to min dart sdk 3.3 2024-05-21 23:08:07 +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 {
            // ...
        }
    });
}