// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. import 'package:built_collection/built_collection.dart'; import 'package:built_value/built_value.dart'; import 'package:meta/meta.dart'; import '../base.dart'; import '../mixins/annotations.dart'; import '../mixins/dartdoc.dart'; import '../visitors.dart'; import 'directive.dart'; import 'expression.dart'; part 'library.g.dart'; @immutable abstract class Library with HasAnnotations, HasDartDocs implements Built, Spec { factory Library([void Function(LibraryBuilder) updates]) = _$Library; Library._(); @override BuiltList get annotations; @override BuiltList get docs; BuiltList get directives; BuiltList get body; /// Line comments to place at the start of the library. BuiltList get comments; /// A comment indicating the tool this library was generated by. /// /// This is typically of the form `Generated by xxx.`; it should exclude /// leading line comment characters. String? get generatedByComment; /// A list of analysis issues to ignore (`ignore_for_file: ...`). BuiltList get ignoreForFile; /// Name of the library. /// /// May be `null` when no [annotations] are specified. String? get name; @override R accept(SpecVisitor visitor, [R? context]) => visitor.visitLibrary(this, context); } abstract class LibraryBuilder with HasAnnotationsBuilder, HasDartDocsBuilder implements Builder { factory LibraryBuilder() = _$LibraryBuilder; LibraryBuilder._(); @override ListBuilder annotations = ListBuilder(); @override ListBuilder docs = ListBuilder(); ListBuilder body = ListBuilder(); ListBuilder directives = ListBuilder(); ListBuilder comments = ListBuilder(); String? generatedByComment; ListBuilder ignoreForFile = ListBuilder(); String? name; }