user_environment 1.0.1

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 49

travis build

User Environment

This package allows to detect the platform and the browser version used to view a web page.

Differentiated browsers are: IE, Edge, Chrome, Safari, Firefox, Opera, Electron, Other along with Mac, Windows and Other platforms.

Usage

  import 'package:user_environment/user_environment.dart';
  void main() {
    UserEnvironment env = UserEnvironmentFactory();
    print([
      env.browser.type,
      env.browser.version?.value,
      env.browser.getFeatureVersion('AppleWebKit'),
      env.platform.type
    ]);
  }

Running tests

pub serve test pub run test -p chrome

Changelog

1.0.1

  • Published version

1.0.0

  • Initial version

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  user_environment: "^1.0.1"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:user_environment/user_environment.dart';
        
Version Uploaded Documentation Archive
1.0.1 Dec 4, 2017 Go to the documentation of user_environment 1.0.1 Download user_environment 1.0.1 archive
1.0.0 Dec 4, 2017 Go to the documentation of user_environment 1.0.0 Download user_environment 1.0.0 archive

Analysis

We analyzed this package on Apr 23, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.49.0
  • pana: 0.10.6

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
3 / 100
Health:
Code health derived from static analysis. [more]
91 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100 / 100
Overall score:
Weighted score of the above. [more]
49
Learn more about scoring.

Platforms

Detected platforms: web

Primary library: package:user_environment/user_environment.dart with components: html, js.

Suggestions

  • The description is too short.

    Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 10 hints.

    Run dartfmt to format lib/src/browser.dart.

    Run dartfmt to format lib/src/browser_impl.dart.

    Similar analysis of the following files failed:

    • lib/src/browser_type.dart (hint)
    • lib/src/environment.dart (hint)
    • lib/src/environment_impl.dart (hint)
    • lib/src/factories.dart (hint)
    • lib/src/platform.dart (hint)
    • lib/src/platform_impl.dart (hint)
    • lib/src/platform_type.dart (hint)
  • Maintain an example.

    Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use user_environment.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.24.1 <2.0.0
browser_detect ^1.0.4 1.0.4
js ^0.6.1 0.6.1
Dev dependencies
analyzer ^0.29.2
dart_dev any
dart_style any
mockito ^2.0.0
test ^0.12.24+1