@@ -14,6 +14,7 @@ import '../components/common/tags.dart';
1414import '../markdown/markdown_parser.dart' ;
1515import '../models/diagnostic_model.dart' ;
1616import '../models/lints.dart' ;
17+ import '../utils/server_only_utils.dart' ;
1718import 'glossary.dart' ;
1819
1920/// All pages that should be loaded from memory rather than
@@ -184,43 +185,49 @@ List<MemoryPage> get _lintMemoryPages {
184185 }
185186 }
186187
188+ final releasedInVersion = lint.releasedInVersion;
189+ final unreleasedLint =
190+ lint.sinceDartSdk == 'Unreleased' ||
191+ lint.sinceDartSdk.contains ('-wip' ) ||
192+ releasedInVersion == null ||
193+ releasedInVersion > runningDartVersion;
194+
187195 return Component .fragment (
188196 [
189197 Tags ([
190- if (lint.sinceDartSdk == 'Unreleased' ||
191- lint.sinceDartSdk.contains ('-wip' ))
198+ if (unreleasedLint)
192199 const Tag (
193200 'Unreleased' ,
194201 icon: 'pending' ,
195- color: ' orange' ,
202+ color: TagColor . orange,
196203 title: 'Lint is unreleased or work in progress.' ,
197204 )
198205 else if (lint.state == 'experimental' )
199206 const Tag (
200207 'Experimental' ,
201208 icon: 'science' ,
202- color: ' orange' ,
209+ color: TagColor . orange,
203210 title: 'Lint is experimental.' ,
204211 )
205212 else if (lint.state == 'deprecated' )
206213 const Tag (
207214 'Deprecated' ,
208215 icon: 'report' ,
209- color: ' orange' ,
216+ color: TagColor . orange,
210217 title: 'Lint is deprecated.' ,
211218 )
212219 else if (lint.state == 'removed' )
213220 const Tag (
214221 'Removed' ,
215222 icon: 'error' ,
216- color: ' red' ,
223+ color: TagColor . red,
217224 title: 'Lint has been removed.' ,
218225 )
219226 else
220227 const Tag (
221228 'Stable' ,
222229 icon: 'verified_user' ,
223- color: ' green' ,
230+ color: TagColor . green,
224231 title: 'Lint is stable.' ,
225232 ),
226233
@@ -250,6 +257,17 @@ List<MemoryPage> get _lintMemoryPages {
250257 icon: 'build' ,
251258 title: 'Lint has one or more quick fixes available.' ,
252259 ),
260+ if (lint.sinceDartSdk != '2.0' )
261+ Tag (
262+ 'Released in Dart ${lint .sinceDartSdk }' ,
263+ icon: 'merge_type' ,
264+ color: TagColor .grey,
265+ title: unreleasedLint
266+ ? 'This lint is set to be '
267+ 'available in Dart ${lint .sinceDartSdk }'
268+ : 'This lint was originally '
269+ 'available in Dart ${lint .sinceDartSdk }.' ,
270+ ),
253271 ]),
254272 DashMarkdown (
255273 content:
0 commit comments