platform/common/user_agent
2024-12-14 20:56:05 -07:00
..
example refactor: refactoring common utils, routes > routing, db drivers 2024-12-14 20:56:05 -07:00
lib refactor: refactoring common utils, routes > routing, db drivers 2024-12-14 20:56:05 -07:00
test refactor: refactoring common utils, routes > routing, db drivers 2024-12-14 20:56:05 -07:00
analysis_options.yaml refactor: refactoring common utils, routes > routing, db drivers 2024-12-14 20:56:05 -07:00
AUTHORS.md refactor: refactoring common utils, routes > routing, db drivers 2024-12-14 20:56:05 -07:00
CHANGELOG.md refactor: refactoring common utils, routes > routing, db drivers 2024-12-14 20:56:05 -07:00
LICENSE refactor: refactoring common utils, routes > routing, db drivers 2024-12-14 20:56:05 -07:00
pubspec.lock refactor: refactoring common utils, routes > routing, db drivers 2024-12-14 20:56:05 -07:00
pubspec.yaml refactor: refactoring common utils, routes > routing, db drivers 2024-12-14 20:56:05 -07:00
README.md refactor: refactoring common utils, routes > routing, db drivers 2024-12-14 20:56:05 -07: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 {
            // ...
        }
    });
}