commit | a09333fb321fd99c26d205e52fa39e71e49739c2 | [log] [tgz] |
---|---|---|
author | Greg Spencer <gspencergoog@users.noreply.github.com> | Mon Aug 16 15:54:26 2021 -0700 |
committer | GitHub <noreply@github.com> | Mon Aug 16 15:54:26 2021 -0700 |
tree | 16ec27d6e045128d1e69809f3db11d71df9af489 | |
parent | f63fd0bc3021354a0687dc935962c9acc003f47e [diff] |
Add FakePlatform.copyWith to allow overriding some values only (#33) This adds a copyWith function to FakePlatform so that it is easy to override just one value from another platform. This can cut down a lot on duplicate code in tests, since you can make one template platform, and then just customize bits of it in each test. Also, updated travis.sh to work with "dart format" instead of "dartfmt", and bumped the version number.
A generic platform abstraction for Dart.
Like dart:io
, package:platform
supplies a rich, Dart-idiomatic API for accessing platform-specific information.
package:platform
provides a lightweight wrapper around the static Platform
properties that exist in dart:io
. However, it uses instance properties rather than static properties, making it possible to mock out in tests.