angel_user_agent 2.0.0

Dart native
Flutter Android iOS

Angel middleware to parse and inject a User Agent object into requests.

0
likes
90 / 110
pub points
0 %
popularity

We analyzed this package on Sep 26, 2020, and awarded it 90 pub points (of a possible 110):

Follow Dart file conventions
20 / 20

10/10 points: Provide a valid pubspec.yaml

5/5 points: Provide a valid README.md

5/5 points: Provide a valid CHANGELOG.md

Provide documentation
20 / 20

10/10 points: Package has an example

  • Found example at: example/example.dart

10/10 points: 20% or more of the public API has dartdoc comments

  • 1 out of 2 API elements (50.0 %) have documentation comments.
Support multiple platforms
10 / 20

10/20 points: Supports 1 of 2 possible platforms (native, js)

Consider supporting multiple platforms:

Package not compatible with runtime js

Because:

  • package:angel_user_agent/angel_user_agent.dart that imports:
  • package:angel_framework/angel_framework.dart that imports:
  • package:angel_framework/src/core/core.dart that imports:
  • package:angel_framework/src/core/service.dart that imports:
  • package:angel_framework/src/core/server.dart that imports:
  • package:angel_framework/src/core/routable.dart that imports:
  • package:angel_framework/src/core/response_context.dart that imports:
  • package:angel_framework/src/core/request_context.dart that imports:
  • package:http_server/http_server.dart that imports:
  • package:http_server/src/http_multipart_form_data.dart that imports:
  • package:http_server/src/http_multipart_form_data_impl.dart that imports:
  • dart:io
Pass static analysis
20 / 30

20/30 points: code has no errors, warnings, lints, or formatting issues

Found 3 issues. Showing the first 2:

INFO: This function has a return type of 'UserAgent', but doesn't end with a return statement.

lib/angel_user_agent.dart:9:44

   ╷
9  │     req.container.registerFactory<UserAgent>((container) {
   │ ┌────────────────────────────────────────────^
10 │ │     var agentString = req.headers.value('user-agent');
11 │ │ 
12 │ │     if (agentString?.trim()?.isNotEmpty != true) {
13 │ │       throw new AngelHttpException.badRequest(
14 │ │           message: 'User-Agent header is required.');
15 │ │     } else if (agentString != null) {
16 │ │       var userAgent = new UserAgent(agentString);
17 │ │       container.registerSingleton<UserAgent>(userAgent);
18 │ │       return userAgent;
19 │ │     }
20 │ │   });
   │ └───^
   ╵

To reproduce make sure you are using pedantic and run dartanalyzer lib/angel_user_agent.dart

INFO: Unnecessary new keyword.

lib/angel_user_agent.dart:13:13

   ╷
13 │         throw new AngelHttpException.badRequest(
   │ ┌─────────────^
14 │ │           message: 'User-Agent header is required.');
   │ └────────────────────────────────────────────────────^
   ╵

To reproduce make sure you are using pedantic and run dartanalyzer lib/angel_user_agent.dart

Support up-to-date dependencies
20 / 20

10/10 points: All of the package dependencies are supported in the latest version

PackageConstraintCompatibleLatest
angel_framework^2.0.0-alpha2.1.12.1.1
user_agent^2.0.02.0.02.0.0
Transitive dependencies
PackageConstraintCompatibleLatest
angel_container-1.1.01.1.0
angel_http_exception-1.1.01.1.0
angel_model-1.0.31.0.3
angel_route-3.1.0+13.1.0+1
charcode-1.1.31.1.3
code_buffer-1.0.11.0.1
collection-1.14.131.14.13
combinator-1.1.01.1.0
convert-2.1.12.1.1
crypto-2.1.52.1.5
dart2_constant-1.0.2+dart21.0.2+dart2
file-5.2.15.2.1
http2-1.0.11.0.1
http_parser-3.1.43.1.4
http_server-0.9.8+30.9.8+3
intl-0.16.10.16.1
logging-0.11.40.11.4
matcher-0.12.90.12.9
merge_map-1.0.21.0.2
meta-1.2.31.2.3
mime-0.9.70.9.7
mock_request-1.0.71.0.7
path-1.7.01.7.0
quiver-2.1.32.1.3
quiver_hashcode-2.0.02.0.0
recase-2.0.13.0.0
source_span-1.7.01.7.0
stack_trace-1.9.51.9.5
string_scanner-1.0.51.0.5
term_glyph-1.1.01.1.0
tuple-1.0.31.0.3
typed_data-1.2.01.2.0
uuid-2.2.22.2.2

To reproduce run pub outdated --no-dev-dependencies --up-to-date --no-dependency-overrides.

10/10 points: Package supports latest stable Dart and Flutter SDKs

0
likes
90
pub points
0%
popularity

Publisher

angel-dart.dev

Angel middleware to parse and inject a User Agent object into requests.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

angel_framework, user_agent

More

Packages that depend on angel_user_agent