Skip to content

Commit 37bec96

Browse files
authored
Bring over latest files from flutter/packages (dart-archive/platform#46)
* Bring over latest files from flutter/packages * Replace Flutter example with Dart example
1 parent 85fcfd4 commit 37bec96

File tree

14 files changed

+162
-72
lines changed

14 files changed

+162
-72
lines changed

pkgs/platform/CHANGELOG.md

Lines changed: 44 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,107 @@
1-
### 3.1.0
1+
## NEXT
2+
3+
* Updates minimum supported SDK version to Flutter 3.16/Dart 3.2.
4+
* Transfers the package source from https://github.com/flutter/packages
5+
to https://github.com/dart-lang/platform.
6+
7+
## 3.1.4
8+
9+
* Updates minimum supported SDK version to Flutter 3.10/Dart 3.0.
10+
* Fixes new lint warnings.
11+
12+
## 3.1.3
13+
14+
* Adds example app.
15+
16+
## 3.1.2
17+
18+
* Adds pub topics to package metadata.
19+
* Updates minimum supported SDK version to Flutter 3.7/Dart 2.19.
20+
21+
## 3.1.1
22+
23+
* Transfers the package source from https://github.com/google/platform.dart to
24+
https://github.com/flutter/packages.
25+
26+
## 3.1.0
227

328
* Removed `Platform.packageRoot`, which was already marked deprecated, and which
429
didn't work in Dart 2.
530

6-
### 3.0.2
31+
## 3.0.2
732

833
* Added `FakePlatform.copyWith` function.
934

10-
### 3.0.1
35+
## 3.0.1
1136

1237
* Added string constants for each of the supported platforms for use in switch
1338
statements.
1439

15-
### 3.0.0
40+
## 3.0.0
1641

1742
* First stable null safe release.
1843

19-
### 3.0.0-nullsafety.4
44+
## 3.0.0-nullsafety.4
2045

2146
* Update supported SDK range.
2247

23-
### 3.0.0-nullsafety.3
48+
## 3.0.0-nullsafety.3
2449

2550
* Update supported SDK range.
2651

27-
### 3.0.0-nullsafety.2
52+
## 3.0.0-nullsafety.2
2853

2954
* Update supported SDK range.
3055

31-
### 3.0.0-nullsafety.1
56+
## 3.0.0-nullsafety.1
3257

3358
* Migrate package to null-safe dart.
3459

35-
### 2.2.1
60+
## 2.2.1
3661

3762
* Add `operatingSystemVersion`
3863

39-
### 2.2.0
64+
## 2.2.0
4065

4166
* Declare compatibility with Dart 2 stable
4267
* Update dependency on `package:test` to 1.0
4368

44-
### 2.1.2
69+
## 2.1.2
4570

4671
* Relax sdk upper bound constraint to '<2.0.0' to allow 'edge' dart sdk use.
4772

48-
### 2.1.1
73+
## 2.1.1
4974

5075
* Bumped maximum Dart SDK version to 2.0.0-dev.infinity
5176

52-
### 2.1.0
77+
## 2.1.0
5378

5479
* Added `localeName`
5580
* Bumped minimum Dart SDK version to 1.24.0-dev.0.0
5681

57-
### 2.0.0
82+
## 2.0.0
5883

5984
* Added `stdinSupportsAnsi` and `stdinSupportsAnsi`
6085
* Removed `ansiSupported`
6186

62-
### 1.1.1
87+
## 1.1.1
6388

6489
* Updated `LocalPlatform` to use new `dart.io` API for ansi color support queries
6590
* Bumped minimum Dart SDK version to 1.23.0-dev.10.0
6691

67-
### 1.1.0
92+
## 1.1.0
6893

6994
* Added `ansiSupported`
7095
* Bumped minimum Dart SDK version to 1.23.0-dev.9.0
7196

72-
#### 1.0.2
97+
## 1.0.2
7398

7499
* Minor doc updates
75100

76-
#### 1.0.1
101+
## 1.0.1
77102

78103
* Added const constructors for `Platform` and `LocalPlatform`
79104

80-
#### 1.0.0
105+
## 1.0.0
81106

82107
* Initial version

pkgs/platform/README.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11
[![Pub](https://img.shields.io/pub/v/platform.svg)](https://pub.dartlang.org/packages/platform)
22

3-
## Moved
4-
5-
The source for the `platform` package has moved to [the `flutter/packages`
6-
repository](https://github.com/flutter/packages/tree/main/packages/platform).
7-
8-
-----
9-
103
A generic platform abstraction for Dart.
114

125
Like `dart:io`, `package:platform` supplies a rich, Dart-idiomatic API for

pkgs/platform/analysis_options.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
include: package:lints/recommended.yaml
1+
include: package:dart_flutter_team_lints/analysis_options.yaml
22

33
analyzer:
44
errors:

pkgs/platform/example/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# https://dart.dev/guides/libraries/private-files
2+
# Created by `dart pub`
3+
.dart_tool/

pkgs/platform/example/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
A small example application demonstrating how to use the platform information
2+
APIs in `package:platform`.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# This file configures the static analysis results for your project (errors,
2+
# warnings, and lints).
3+
#
4+
# This enables the 'recommended' set of lints from `package:lints`.
5+
# This set helps identify many issues that may lead to problems when running
6+
# or consuming Dart code, and enforces writing Dart using a single, idiomatic
7+
# style and format.
8+
#
9+
# If you want a smaller set of lints you can change this to specify
10+
# 'package:lints/core.yaml'. These are just the most critical lints
11+
# (the recommended set includes the core lints).
12+
# The core lints are also what is used by pub.dev for scoring packages.
13+
14+
include: package:lints/recommended.yaml
15+
16+
# Uncomment the following section to specify additional rules.
17+
18+
# linter:
19+
# rules:
20+
# - camel_case_types
21+
22+
# analyzer:
23+
# exclude:
24+
# - path/to/excluded/files/**
25+
26+
# For more information about the core and recommended set of lints, see
27+
# https://dart.dev/go/core-lints
28+
29+
# For additional information about configuring this file, see
30+
# https://dart.dev/guides/language/analysis-options
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import 'package:platform/platform.dart';
2+
3+
void main(List<String> arguments) {
4+
const LocalPlatform platform = LocalPlatform();
5+
6+
print('Operating System: ${platform.operatingSystem}.');
7+
print('Local Hostname: ${platform.localHostname}.');
8+
print('Number of Processors: ${platform.numberOfProcessors}.');
9+
print('Path Separator: ${platform.pathSeparator}.');
10+
print('Locale Name: ${platform.localeName}.');
11+
print('Stdin Supports ANSI: ${platform.stdinSupportsAnsi}.');
12+
print('Stdout Supports ANSI: ${platform.stdoutSupportsAnsi}.');
13+
print('Executable Arguments: ${platform.executableArguments}.');
14+
print('Dart Version: ${platform.version}.');
15+
}

pkgs/platform/example/pubspec.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: example
2+
description: Demonstrates how to use the platform api.
3+
version: 1.0.0
4+
publish_to: none
5+
6+
environment:
7+
sdk: ^3.2.0
8+
9+
dependencies:
10+
platform:
11+
path: ../
12+
13+
dev_dependencies:
14+
lints: ^4.0.0

pkgs/platform/lib/platform.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
2-
// for details. All rights reserved. Use of this source code is governed by a
3-
// BSD-style license that can be found in the LICENSE file.
1+
// Copyright 2013 The Flutter Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
44

5-
/// Core interfaces & classes.
5+
// Core interfaces & classes.
66
export 'src/interface/local_platform.dart';
77
export 'src/interface/platform.dart';
88
export 'src/testing/fake_platform.dart';

pkgs/platform/lib/src/interface/local_platform.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
2-
// for details. All rights reserved. Use of this source code is governed by a
3-
// BSD-style license that can be found in the LICENSE file.
1+
// Copyright 2013 The Flutter Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
44

55
import 'dart:io' as io show Platform, stdin, stdout;
66

0 commit comments

Comments
 (0)