user_agent 1.0.0-beta user_agent: ^1.0.0-beta copied to clipboard
A Dart user agent detection library.
user_agent #
Dart user agent detection library. Uses the code from both dart:html
and package:r2d2
.
Runs anywhere.
main() async {
app.before.add('*', (req, res) async {
var ua = new UserAgent(req.headers.value('user-agent'));
if (ua.isChrome) {
res.redirect('/upgrade-your-browser');
return;
} else {
// ...
}
});
}