Skip to content

Commit

Permalink
Add const constructors for Platform and LocalPlatform
Browse files Browse the repository at this point in the history
  • Loading branch information
tvolkert committed Jan 25, 2017
1 parent 9be4623 commit 5c97211
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/src/interface/local_platform.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ import 'platform.dart';

/// `Platform` implementation that delegates directly to `dart:io`.
class LocalPlatform extends Platform {
/// Creates a new [LocalPlatform].
const LocalPlatform();

@override
int get numberOfProcessors => io.Platform.numberOfProcessors;

Expand Down
3 changes: 3 additions & 0 deletions lib/src/interface/platform.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ import 'dart:convert';
/// instance properties rather than static properties. This difference enables
/// the use of these APIs in tests, where you can provide mock implementations.
abstract class Platform {
/// Creates a new [Platform].
const Platform();

/// The number of processors of the machine.
int get numberOfProcessors;

Expand Down

0 comments on commit 5c97211

Please sign in to comment.