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+
16#### 1.0.2
27
38* Minor doc updates
Original file line number Diff line number Diff line change @@ -46,4 +46,7 @@ class LocalPlatform extends Platform {
4646
4747 @override
4848 String get version => io.Platform .version;
49+
50+ @override
51+ bool get ansiSupported => io.Platform .ansiSupported;
4952}
Original file line number Diff line number Diff line change @@ -114,6 +114,12 @@ abstract class Platform {
114114 /// whitespace and other version and build details.
115115 String get version;
116116
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+
117123 /// Returns a JSON-encoded representation of this platform.
118124 String toJson () {
119125 return const JsonEncoder .withIndent (' ' ).convert (< String , dynamic > {
@@ -129,6 +135,7 @@ abstract class Platform {
129135 'packageRoot' : packageRoot,
130136 'packageConfig' : packageConfig,
131137 'version' : version,
138+ 'ansiSupported' : ansiSupported,
132139 });
133140 }
134141}
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ class FakePlatform extends Platform {
2525 this .packageRoot,
2626 this .packageConfig,
2727 this .version,
28+ this .ansiSupported,
2829 });
2930
3031 /// Creates a new [FakePlatform] with properties whose initial values mirror
@@ -41,7 +42,8 @@ class FakePlatform extends Platform {
4142 executableArguments = new List <String >.from (platform.executableArguments),
4243 packageRoot = platform.packageRoot,
4344 packageConfig = platform.packageConfig,
44- version = platform.version;
45+ version = platform.version,
46+ ansiSupported = platform.ansiSupported;
4547
4648 /// Creates a new [FakePlatform] with properties extracted from the encoded
4749 /// JSON string.
@@ -63,6 +65,7 @@ class FakePlatform extends Platform {
6365 packageRoot : map['packageRoot' ],
6466 packageConfig : map['packageConfig' ],
6567 version : map['version' ],
68+ ansiSupported: map['ansiSupported' ],
6669 );
6770 }
6871
@@ -101,4 +104,7 @@ class FakePlatform extends Platform {
101104
102105 @override
103106 String version;
107+
108+ @override
109+ bool ansiSupported;
104110}
Original file line number Diff line number Diff line change 11name : platform
2- version : 1.0.2
2+ version : 1.1.0
33authors :
44-
Todd Volkert <[email protected] > 55description : A pluggable, mockable platform abstraction for Dart.
@@ -9,4 +9,4 @@ dev_dependencies:
99 test : ^0.12.10
1010
1111environment :
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