Published user_agent

This commit is contained in:
thomashii 2021-06-21 12:43:13 +08:00
parent 51b7e553ea
commit d95cf1ef63
7 changed files with 27 additions and 17 deletions

View file

@ -71,6 +71,7 @@
* Migrated angel_sync to 3.0.0 (0/1 tests passed) * Migrated angel_sync to 3.0.0 (0/1 tests passed)
* Migrated angel_typed_service to 3.0.0 (4/4 tests passed) * Migrated angel_typed_service to 3.0.0 (4/4 tests passed)
* Migrated angel_shelf to 2.0.0 (0/1 tests passed) * Migrated angel_shelf to 2.0.0 (0/1 tests passed)
* Migrated user_agent to 2.0.0 (0/0 tests passed)
* Migrated angel_user_agent to 2.0.0 (0/0 tests passed) * Migrated angel_user_agent to 2.0.0 (0/0 tests passed)
# 3.0.0 (Non NNBD) # 3.0.0 (Non NNBD)

View file

@ -1,9 +1,13 @@
# 3.0.0 # Change Log
## 3.0.0
* Migrated to support Dart SDK 2.12.x NNBD * Migrated to support Dart SDK 2.12.x NNBD
# 2.0.0 ## 2.0.0
* Dart 2 updates. * Dart 2 updates.
## 0.0.1 ## 0.0.1
- Initial version, created by Stagehand * Initial version, created by Stagehand

View file

@ -1,14 +1,21 @@
# user_agent # User Agent Analyzer
Simple Dart user agent detection library.
[![version](https://img.shields.io/badge/pub-v3.0.0-brightgreen)](https://pub.dartlang.org/packages/user_agent_analyzer)
[![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety)
[![Gitter](https://img.shields.io/gitter/room/angel_dart/discussion)](https://gitter.im/angel_dart/discussion)
[![License](https://img.shields.io/github/license/dukefirehawk/angel)](https://github.com/dukefirehawk/angel/tree/angel3/packages/user_agent/user_agent/LICENSE)
**Forked from `user_agent` to support NNBD**
A library that identify the type of devices and web browsers based on User-Agent.
Runs anywhere. Runs anywhere.
Incorporates some code from the old `package:r2d2`.
```dart ```dart
main() async { void main() async {
app.get('/', (req, res) async { app.get('/', (req, res) async {
var ua = new UserAgent(req.headers.value('user-agent')); var ua = UserAgent(req.headers.value('user-agent'));
if (ua.isChrome) { if (ua.isChrome) {
res.redirect('/upgrade-your-browser'); res.redirect('/upgrade-your-browser');

View file

@ -1,4 +1,4 @@
import 'package:user_agent/user_agent.dart'; import 'package:user_agent_analyzer/user_agent_analyzer.dart';
void main() { void main() {
var ua = UserAgent( var ua = UserAgent(

View file

@ -1,4 +1,4 @@
library user_agent; library user_agent_analyzer;
/// Utils for device detection. /// Utils for device detection.
class UserAgent { class UserAgent {

View file

@ -1,8 +1,6 @@
name: user_agent name: user_agent_analyzer
version: 3.0.0 version: 3.0.0
description: A Dart user agent detection library. description: A library that identify the type of devices and web browsers based on User-Agent.
homepage: https://github.com/thosakwe/user_agent
publish_to: none
environment: environment:
sdk: '>=2.12.0 <3.0.0' sdk: '>=2.12.0 <3.0.0'
dev_dependencies: dev_dependencies:

View file

@ -1,7 +1,7 @@
// Copyright (c) 2017, thosakwe. All rights reserved. Use of this source code // Copyright (c) 2017, thosakwe. All rights reserved. Use of this source code
// is governed by a BSD-style license that can be found in the LICENSE file. // is governed by a BSD-style license that can be found in the LICENSE file.
import 'package:user_agent/user_agent.dart'; import 'package:user_agent_analyzer/user_agent_analyzer.dart';
import 'package:test/test.dart'; import 'package:test/test.dart';
void main() { void main() {