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
d42dcf2e
Unverified
Commit
d42dcf2e
authored
May 18, 2020
by
Alexandre Ardhuin
Committed by
GitHub
May 18, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add @factory to create* methods (#57299)
parent
79ad2d2e
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
14 additions
and
0 deletions
+14
-0
foundation.dart
packages/flutter/lib/foundation.dart
+1
-0
multidrag.dart
packages/flutter/lib/src/gestures/multidrag.dart
+1
-0
ink_well.dart
packages/flutter/lib/src/material/ink_well.dart
+1
-0
decoration.dart
packages/flutter/lib/src/painting/decoration.dart
+1
-0
gradient.dart
packages/flutter/lib/src/painting/gradient.dart
+1
-0
mouse_cursor.dart
packages/flutter/lib/src/rendering/mouse_cursor.dart
+1
-0
ticker.dart
packages/flutter/lib/src/scheduler/ticker.dart
+1
-0
framework.dart
packages/flutter/lib/src/widgets/framework.dart
+5
-0
navigator.dart
packages/flutter/lib/src/widgets/navigator.dart
+1
-0
routes.dart
packages/flutter/lib/src/widgets/routes.dart
+1
-0
No files found.
packages/flutter/lib/foundation.dart
View file @
d42dcf2e
...
@@ -10,6 +10,7 @@
...
@@ -10,6 +10,7 @@
library
foundation
;
library
foundation
;
export
'package:meta/meta.dart'
show
export
'package:meta/meta.dart'
show
factory
,
immutable
,
immutable
,
mustCallSuper
,
mustCallSuper
,
nonVirtual
,
nonVirtual
,
...
...
packages/flutter/lib/src/gestures/multidrag.dart
View file @
d42dcf2e
...
@@ -220,6 +220,7 @@ abstract class MultiDragGestureRecognizer<T extends MultiDragPointerState> exten
...
@@ -220,6 +220,7 @@ abstract class MultiDragGestureRecognizer<T extends MultiDragPointerState> exten
/// Subclasses should override this method to create per-pointer state
/// Subclasses should override this method to create per-pointer state
/// objects to track the pointer associated with the given event.
/// objects to track the pointer associated with the given event.
@protected
@protected
@factory
T
createNewPointerState
(
PointerDownEvent
event
);
T
createNewPointerState
(
PointerDownEvent
event
);
void
_handleEvent
(
PointerEvent
event
)
{
void
_handleEvent
(
PointerEvent
event
)
{
...
...
packages/flutter/lib/src/material/ink_well.dart
View file @
d42dcf2e
...
@@ -159,6 +159,7 @@ abstract class InteractiveInkFeatureFactory {
...
@@ -159,6 +159,7 @@ abstract class InteractiveInkFeatureFactory {
///
///
/// Subclasses should override this method to return a new instance of an
/// Subclasses should override this method to return a new instance of an
/// [InteractiveInkFeature].
/// [InteractiveInkFeature].
@factory
InteractiveInkFeature
create
({
InteractiveInkFeature
create
({
@required
MaterialInkController
controller
,
@required
MaterialInkController
controller
,
@required
RenderBox
referenceBox
,
@required
RenderBox
referenceBox
,
...
...
packages/flutter/lib/src/painting/decoration.dart
View file @
d42dcf2e
...
@@ -164,6 +164,7 @@ abstract class Decoration with Diagnosticable {
...
@@ -164,6 +164,7 @@ abstract class Decoration with Diagnosticable {
/// The `onChanged` argument configures [BoxPainter.onChanged]. It can be
/// The `onChanged` argument configures [BoxPainter.onChanged]. It can be
/// omitted if there is no chance that the painter will change (for example,
/// omitted if there is no chance that the painter will change (for example,
/// if it is a [BoxDecoration] with definitely no [DecorationImage]).
/// if it is a [BoxDecoration] with definitely no [DecorationImage]).
@factory
BoxPainter
createBoxPainter
([
VoidCallback
onChanged
]);
BoxPainter
createBoxPainter
([
VoidCallback
onChanged
]);
/// Returns a closed [Path] that describes the outer edge of this decoration.
/// Returns a closed [Path] that describes the outer edge of this decoration.
...
...
packages/flutter/lib/src/painting/gradient.dart
View file @
d42dcf2e
...
@@ -201,6 +201,7 @@ abstract class Gradient {
...
@@ -201,6 +201,7 @@ abstract class Gradient {
///
///
/// The shader's transform will be resolved from the [transform] of this
/// The shader's transform will be resolved from the [transform] of this
/// gradient.
/// gradient.
@factory
Shader
createShader
(
Rect
rect
,
{
TextDirection
textDirection
});
Shader
createShader
(
Rect
rect
,
{
TextDirection
textDirection
});
/// Returns a new gradient with its properties scaled by the given factor.
/// Returns a new gradient with its properties scaled by the given factor.
...
...
packages/flutter/lib/src/rendering/mouse_cursor.dart
View file @
d42dcf2e
...
@@ -213,6 +213,7 @@ abstract class MouseCursor with Diagnosticable {
...
@@ -213,6 +213,7 @@ abstract class MouseCursor with Diagnosticable {
/// cursor. A given cursor can be displayed by multiple devices at the same
/// cursor. A given cursor can be displayed by multiple devices at the same
/// time, in which case this method will be called separately for each device.
/// time, in which case this method will be called separately for each device.
@protected
@protected
@factory
MouseCursorSession
createSession
(
int
device
);
MouseCursorSession
createSession
(
int
device
);
/// A very short description of the mouse cursor.
/// A very short description of the mouse cursor.
...
...
packages/flutter/lib/src/scheduler/ticker.dart
View file @
d42dcf2e
...
@@ -35,6 +35,7 @@ abstract class TickerProvider {
...
@@ -35,6 +35,7 @@ abstract class TickerProvider {
/// Creates a ticker with the given callback.
/// Creates a ticker with the given callback.
///
///
/// The kind of ticker provided depends on the kind of ticker provider.
/// The kind of ticker provided depends on the kind of ticker provider.
@factory
Ticker
createTicker
(
TickerCallback
onTick
);
Ticker
createTicker
(
TickerCallback
onTick
);
}
}
...
...
packages/flutter/lib/src/widgets/framework.dart
View file @
d42dcf2e
...
@@ -16,6 +16,7 @@ import 'inherited_model.dart';
...
@@ -16,6 +16,7 @@ import 'inherited_model.dart';
export
'dart:ui'
show
hashValues
,
hashList
;
export
'dart:ui'
show
hashValues
,
hashList
;
export
'package:flutter/foundation.dart'
show
export
'package:flutter/foundation.dart'
show
factory
,
immutable
,
immutable
,
mustCallSuper
,
mustCallSuper
,
optionalTypeArgs
,
optionalTypeArgs
,
...
@@ -488,6 +489,7 @@ abstract class Widget extends DiagnosticableTree {
...
@@ -488,6 +489,7 @@ abstract class Widget extends DiagnosticableTree {
/// widget that is incorporated into the tree multiple times will be inflated
/// widget that is incorporated into the tree multiple times will be inflated
/// multiple times.
/// multiple times.
@protected
@protected
@factory
Element
createElement
();
Element
createElement
();
/// A short, textual description of this widget.
/// A short, textual description of this widget.
...
@@ -911,6 +913,7 @@ abstract class StatefulWidget extends Widget {
...
@@ -911,6 +913,7 @@ abstract class StatefulWidget extends Widget {
/// again to create a fresh [State] object, simplifying the lifecycle of
/// again to create a fresh [State] object, simplifying the lifecycle of
/// [State] objects.
/// [State] objects.
@protected
@protected
@factory
State
createState
();
State
createState
();
}
}
...
@@ -1730,6 +1733,7 @@ abstract class RenderObjectWidget extends Widget {
...
@@ -1730,6 +1733,7 @@ abstract class RenderObjectWidget extends Widget {
/// RenderObjectWidgets always inflate to a [RenderObjectElement] subclass.
/// RenderObjectWidgets always inflate to a [RenderObjectElement] subclass.
@override
@override
@factory
RenderObjectElement
createElement
();
RenderObjectElement
createElement
();
/// Creates an instance of the [RenderObject] class that this
/// Creates an instance of the [RenderObject] class that this
...
@@ -1742,6 +1746,7 @@ abstract class RenderObjectWidget extends Widget {
...
@@ -1742,6 +1746,7 @@ abstract class RenderObjectWidget extends Widget {
/// [createElement] method. See, for example,
/// [createElement] method. See, for example,
/// [SingleChildRenderObjectElement.mount].
/// [SingleChildRenderObjectElement.mount].
@protected
@protected
@factory
RenderObject
createRenderObject
(
BuildContext
context
);
RenderObject
createRenderObject
(
BuildContext
context
);
/// Copies the configuration described by this [RenderObjectWidget] to the
/// Copies the configuration described by this [RenderObjectWidget] to the
...
...
packages/flutter/lib/src/widgets/navigator.dart
View file @
d42dcf2e
...
@@ -524,6 +524,7 @@ abstract class Page<T> extends RouteSettings {
...
@@ -524,6 +524,7 @@ abstract class Page<T> extends RouteSettings {
/// Creates the [Route] that corresponds to this page.
/// Creates the [Route] that corresponds to this page.
///
///
/// The created [Route] must have its [Route.settings] property set to this [Page].
/// The created [Route] must have its [Route.settings] property set to this [Page].
@factory
Route
<
T
>
createRoute
(
BuildContext
context
);
Route
<
T
>
createRoute
(
BuildContext
context
);
@override
@override
...
...
packages/flutter/lib/src/widgets/routes.dart
View file @
d42dcf2e
...
@@ -31,6 +31,7 @@ abstract class OverlayRoute<T> extends Route<T> {
...
@@ -31,6 +31,7 @@ abstract class OverlayRoute<T> extends Route<T> {
})
:
super
(
settings:
settings
);
})
:
super
(
settings:
settings
);
/// Subclasses should override this getter to return the builders for the overlay.
/// Subclasses should override this getter to return the builders for the overlay.
@factory
Iterable
<
OverlayEntry
>
createOverlayEntries
();
Iterable
<
OverlayEntry
>
createOverlayEntries
();
@override
@override
...
...
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