This repository was archived by the owner on Jan 13, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +24
-3
lines changed Expand file tree Collapse file tree 5 files changed +24
-3
lines changed Original file line number Diff line number Diff line change
1
+ ### 1.1.0
2
+
3
+ * Added ` ansiSupported `
4
+ * Bumped minimum Dart SDK version to 1.23.0-dev.9.0
5
+
1
6
#### 1.0.2
2
7
3
8
* Minor doc updates
Original file line number Diff line number Diff line change @@ -46,4 +46,7 @@ class LocalPlatform extends Platform {
46
46
47
47
@override
48
48
String get version => io.Platform .version;
49
+
50
+ @override
51
+ bool get ansiSupported => io.Platform .ansiSupported;
49
52
}
Original file line number Diff line number Diff line change @@ -114,6 +114,12 @@ abstract class Platform {
114
114
/// whitespace and other version and build details.
115
115
String get version;
116
116
117
+ /// When stdio is connected to a terminal, whether ANSI codes are supported.
118
+ ///
119
+ /// This value is hard-coded to true, except on Windows where only more recent
120
+ /// versions of Windows 10 support the codes.
121
+ bool get ansiSupported;
122
+
117
123
/// Returns a JSON-encoded representation of this platform.
118
124
String toJson () {
119
125
return const JsonEncoder .withIndent (' ' ).convert (< String , dynamic > {
@@ -129,6 +135,7 @@ abstract class Platform {
129
135
'packageRoot' : packageRoot,
130
136
'packageConfig' : packageConfig,
131
137
'version' : version,
138
+ 'ansiSupported' : ansiSupported,
132
139
});
133
140
}
134
141
}
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ class FakePlatform extends Platform {
25
25
this .packageRoot,
26
26
this .packageConfig,
27
27
this .version,
28
+ this .ansiSupported,
28
29
});
29
30
30
31
/// Creates a new [FakePlatform] with properties whose initial values mirror
@@ -41,7 +42,8 @@ class FakePlatform extends Platform {
41
42
executableArguments = new List <String >.from (platform.executableArguments),
42
43
packageRoot = platform.packageRoot,
43
44
packageConfig = platform.packageConfig,
44
- version = platform.version;
45
+ version = platform.version,
46
+ ansiSupported = platform.ansiSupported;
45
47
46
48
/// Creates a new [FakePlatform] with properties extracted from the encoded
47
49
/// JSON string.
@@ -63,6 +65,7 @@ class FakePlatform extends Platform {
63
65
packageRoot : map['packageRoot' ],
64
66
packageConfig : map['packageConfig' ],
65
67
version : map['version' ],
68
+ ansiSupported: map['ansiSupported' ],
66
69
);
67
70
}
68
71
@@ -101,4 +104,7 @@ class FakePlatform extends Platform {
101
104
102
105
@override
103
106
String version;
107
+
108
+ @override
109
+ bool ansiSupported;
104
110
}
Original file line number Diff line number Diff line change 1
1
name : platform
2
- version : 1.0.2
2
+ version : 1.1.0
3
3
authors :
4
4
-
Todd Volkert <[email protected] >
5
5
description : A pluggable, mockable platform abstraction for Dart.
@@ -9,4 +9,4 @@ dev_dependencies:
9
9
test : ^0.12.10
10
10
11
11
environment :
12
- sdk : ' >=1.19 .0 <2.0.0'
12
+ sdk : ' >=1.23.0-dev.9 .0 <2.0.0'
You can’t perform that action at this time.
0 commit comments