2
2
// for details. All rights reserved. Use of this source code is governed by a
3
3
// BSD-style license that can be found in the LICENSE file.
4
4
5
- import 'package:analyzer/dart/element/element.dart' ;
6
5
import 'package:dartdoc/src/model/model.dart' ;
7
6
8
7
typedef ContainerSidebar = String Function (
@@ -411,21 +410,16 @@ class MethodTemplateData extends TemplateData<Method>
411
410
final Container container;
412
411
final ContainerSidebar _sidebarForContainer;
413
412
414
- final String _containerDescription;
415
-
416
413
MethodTemplateData (super .htmlOptions, super .packageGraph, this .library,
417
- this .container, this .method, this ._sidebarForContainer)
418
- : _containerDescription =
419
- // TODO(srawlins): No mixin? enum?
420
- container is InterfaceElement ? 'class' : 'extension' ;
414
+ this .container, this .method, this ._sidebarForContainer);
421
415
422
416
String get sidebarForContainer => _sidebarForContainer (container, this );
423
417
424
418
@override
425
419
Method get self => method;
426
420
@override
427
421
String get title =>
428
- '${method .name } method - ${container .name } $_containerDescription - '
422
+ '${method .name } method - ${container .name } ${ container . kind } - '
429
423
'${library .name } library - Dart API' ;
430
424
@override
431
425
String get layoutTitle =>
@@ -434,7 +428,7 @@ class MethodTemplateData extends TemplateData<Method>
434
428
@override
435
429
String get metaDescription =>
436
430
'API docs for the ${method .name } method from the ${container .name } '
437
- '$_containerDescription , for the Dart programming language.' ;
431
+ '${ container . kind } , for the Dart programming language.' ;
438
432
@override
439
433
List <Documentable > get navLinks => [_packageGraph.defaultPackage, library];
440
434
@override
@@ -452,12 +446,9 @@ class PropertyTemplateData extends TemplateData<Field>
452
446
final Container container;
453
447
final Field property;
454
448
final ContainerSidebar _sidebarForContainer;
455
- final String _containerDescription;
456
449
457
450
PropertyTemplateData (super .htmlOptions, super .packageGraph, this .library,
458
- this .container, this .property, this ._sidebarForContainer)
459
- : _containerDescription =
460
- container is InterfaceElement ? 'class' : 'extension' ;
451
+ this .container, this .property, this ._sidebarForContainer);
461
452
462
453
String get sidebarForContainer => _sidebarForContainer (container, this );
463
454
@@ -466,15 +457,15 @@ class PropertyTemplateData extends TemplateData<Field>
466
457
467
458
@override
468
459
String get title => '${property .name } ${property .kind } - '
469
- '${container .name } $_containerDescription - '
460
+ '${container .name } ${ container . kind } - '
470
461
'${library .name } library - Dart API' ;
471
462
@override
472
463
String get layoutTitle => _layoutTitle (property.name, property.fullkind,
473
464
isDeprecated: property.isDeprecated);
474
465
@override
475
466
String get metaDescription =>
476
467
'API docs for the ${property .name } ${property .kind } from the '
477
- '${container .name } $_containerDescription , '
468
+ '${container .name } ${ container . kind } , '
478
469
'for the Dart programming language.' ;
479
470
@override
480
471
List <Documentable > get navLinks => [_packageGraph.defaultPackage, library];
@@ -506,7 +497,7 @@ class TypedefTemplateData extends TemplateData<Typedef>
506
497
isDeprecated: typeDef.isDeprecated);
507
498
@override
508
499
String get metaDescription =>
509
- 'API docs for the ${typeDef .name } property from the '
500
+ 'API docs for the ${typeDef .name } typedef from the '
510
501
'${library .name } library, for the Dart programming language.' ;
511
502
@override
512
503
List <Documentable > get navLinks => [_packageGraph.defaultPackage, library];
0 commit comments