Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
95eba52e
Commit
95eba52e
authored
Jun 19, 2017
by
Ian Hickson
Committed by
GitHub
Jun 19, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Define some annotations for generating the widget catalog. (#10816)
parent
cf930390
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
111 additions
and
0 deletions
+111
-0
foundation.dart
packages/flutter/lib/foundation.dart
+2
-0
annotations.dart
packages/flutter/lib/src/foundation/annotations.dart
+109
-0
No files found.
packages/flutter/lib/foundation.dart
View file @
95eba52e
...
@@ -21,11 +21,13 @@ export 'package:meta/meta.dart' show
...
@@ -21,11 +21,13 @@ export 'package:meta/meta.dart' show
// bool _first;
// bool _first;
// bool _lights;
// bool _lights;
// bool _visible;
// bool _visible;
// class Cat { }
// double _volume;
// double _volume;
// dynamic _calculation;
// dynamic _calculation;
// dynamic _last;
// dynamic _last;
// dynamic _selection;
// dynamic _selection;
export
'src/foundation/annotations.dart'
;
export
'src/foundation/assertions.dart'
;
export
'src/foundation/assertions.dart'
;
export
'src/foundation/basic_types.dart'
;
export
'src/foundation/basic_types.dart'
;
export
'src/foundation/binding.dart'
;
export
'src/foundation/binding.dart'
;
...
...
packages/flutter/lib/src/foundation/annotations.dart
0 → 100644
View file @
95eba52e
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/// A category with which to annotate a class, for documentation
/// purposes.
///
/// A category is usually represented as a section and a subsection, each
/// of which is a string. The engineering team that owns the library to which
/// the class belongs defines the categories used for classes in that library.
/// For example, the Flutter engineering team has defined categories like
/// "Basic/Buttons" and "Material Design/Buttons" for Flutter widgets.
///
/// A class can have multiple categories.
///
/// ## Sample code
///
/// ```dart
/// /// A copper coffee pot, as desired by Ben Turpin.
/// /// ...documentation...
/// @Category(const <String>['Pots', 'Coffee'])
/// @Category(const <String>['Copper', 'Cookware'])
/// @DocumentationIcon('https://example.com/images/coffee.png')
/// @Summary('A proper cup of coffee is made in a proper copper coffee pot.')
/// class CopperCoffeePot {
/// // ...code...
/// }
/// ```
///
/// See also:
///
/// * [DocumentationIcon], which is used to give the URL to an image that
/// represents the class.
/// * [Summary], which is used to provide a one-line description of a
/// class that overrides the inline documentations' own description.
class
Category
{
const
Category
(
this
.
sections
)
:
assert
(
sections
!=
null
);
/// The strings the correspond to the section and subsection of the
/// category represented by this object.
///
/// By convention, this list usually has two items. The allowed values
/// are defined by the team that owns the library to which the annotated
/// class belongs.
final
List
<
String
>
sections
;
}
/// A class annotation to provide a URL to an image that represents the class.
///
/// Each class should only have one [DocumentationIcon].
///
/// ## Sample code
///
/// ```dart
/// /// Utility class for beginning a dream-sharing sequence.
/// /// ...documentation...
/// @Category(const <String>['Military Technology', 'Experimental'])
/// @DocumentationIcon('https://docs.example.org/icons/top.png')
/// class DreamSharing {
/// // ...code...
/// }
/// ```
///
/// See also:
///
/// * [Category], to help place the class in an index.
/// * [Summary], which is used to provide a one-line description of a
/// class that overrides the inline documentations' own description.
class
DocumentationIcon
{
const
DocumentationIcon
(
this
.
url
)
:
assert
(
url
!=
null
);
/// The URL to an image that represents the annotated class.
final
String
url
;
}
/// An annotation that provides a short description of a class for use
/// in an index.
///
/// Usually the first paragraph of the documentation for a class can be used
/// for this purpose, but on occasion the first paragraph is either too short
/// or too long for use in isolation, without the remainder of the documentation.
///
/// ## Sample code
///
/// ```dart
/// /// A famous cat.
/// ///
/// /// Instances of this class can hunt small animals.
/// /// This cat has three legs.
/// @Category(const <String>['Animals', 'Cats'])
/// @Category(const <String>['Cute', 'Pets'])
/// @DocumentationIcon('https://www.examples.net/docs/images/icons/pillar.jpeg')
/// @Summary('A famous three-legged cat.')
/// class Pillar extends Cat {
/// // ...code...
/// }
/// ```
///
/// See also:
///
/// * [Category], to help place the class in an index.
/// * [DocumentationIcon], which is used to give the URL to an image that
/// represents the class.
class
Summary
{
const
Summary
(
this
.
text
)
:
assert
(
text
!=
null
);
/// The text of the summary of the annotated class.
final
String
text
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment