Start fixing docs (#45977)
This commit is contained in:
parent
b96d818c19
commit
b61dec79c7
@ -125,12 +125,13 @@ enum AnimationBehavior {
|
||||
///
|
||||
/// {@tool sample}
|
||||
///
|
||||
/// Here is a stateful [Foo] widget. Its [State] uses the
|
||||
/// Here is a stateful `Foo` widget. Its [State] uses the
|
||||
/// [SingleTickerProviderStateMixin] to implement the necessary
|
||||
/// [TickerProvider], creating its controller in the [initState] method and
|
||||
/// disposing of it in the [dispose] method. The duration of the controller is
|
||||
/// configured from a property in the [Foo] widget; as that changes, the
|
||||
/// [didUpdateWidget] method is used to update the controller.
|
||||
/// [TickerProvider], creating its controller in the [State.initState] method
|
||||
/// and disposing of it in the [State.dispose] method. The duration of the
|
||||
/// controller is configured from a property in the `Foo` widget; as that
|
||||
/// changes, the [State.didUpdateWidget] method is used to update the
|
||||
/// controller.
|
||||
///
|
||||
/// ```dart
|
||||
/// class Foo extends StatefulWidget {
|
||||
|
@ -396,12 +396,12 @@ class ConstantTween<T> extends Tween<T> {
|
||||
/// Create a tween whose [begin] and [end] values equal [value].
|
||||
ConstantTween(T value) : super(begin: value, end: value);
|
||||
|
||||
/// This tween doesn't interpolate, it always returns [value].
|
||||
/// This tween doesn't interpolate, it always returns the same value.
|
||||
@override
|
||||
T lerp(double t) => begin;
|
||||
|
||||
@override
|
||||
String toString() => '$runtimeType(value: begin)';
|
||||
String toString() => '$runtimeType(value: $begin)';
|
||||
}
|
||||
|
||||
/// Transforms the value of the given animation by the given curve.
|
||||
|
@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'dart:ui' show Color;
|
||||
import 'dart:ui' show Color, Brightness;
|
||||
|
||||
import '../../foundation.dart';
|
||||
import '../widgets/basic.dart';
|
||||
@ -790,8 +790,8 @@ class CupertinoDynamicColor extends Color with DiagnosticableMixin implements Di
|
||||
///
|
||||
/// In other words, this color will be the effective color of the [CupertinoDynamicColor]
|
||||
/// after it is resolved against a [BuildContext] that:
|
||||
/// - has a [CupertinoTheme] whose [brightness] is [PlatformBrightness.light],
|
||||
/// or a [MediaQuery] whose [MediaQueryData.platformBrightness] is [PlatformBrightness.light].
|
||||
/// - has a [CupertinoTheme] whose [brightness] is [Brightness.light],
|
||||
/// or a [MediaQuery] whose [MediaQueryData.platformBrightness] is [Brightness.light].
|
||||
/// - has a [MediaQuery] whose [MediaQueryData.highContrast] is `false`.
|
||||
/// - has a [CupertinoUserInterfaceLevel] that indicates [CupertinoUserInterfaceLevelData.base].
|
||||
final Color color;
|
||||
@ -801,8 +801,8 @@ class CupertinoDynamicColor extends Color with DiagnosticableMixin implements Di
|
||||
///
|
||||
/// In other words, this color will be the effective color of the [CupertinoDynamicColor]
|
||||
/// after it is resolved against a [BuildContext] that:
|
||||
/// - has a [CupertinoTheme] whose [brightness] is [PlatformBrightness.dark],
|
||||
/// or a [MediaQuery] whose [MediaQueryData.platformBrightness] is [PlatformBrightness.dark].
|
||||
/// - has a [CupertinoTheme] whose [brightness] is [Brightness.dark],
|
||||
/// or a [MediaQuery] whose [MediaQueryData.platformBrightness] is [Brightness.dark].
|
||||
/// - has a [MediaQuery] whose [MediaQueryData.highContrast] is `false`.
|
||||
/// - has a [CupertinoUserInterfaceLevel] that indicates [CupertinoUserInterfaceLevelData.base].
|
||||
final Color darkColor;
|
||||
@ -812,8 +812,8 @@ class CupertinoDynamicColor extends Color with DiagnosticableMixin implements Di
|
||||
///
|
||||
/// In other words, this color will be the effective color of the [CupertinoDynamicColor]
|
||||
/// after it is resolved against a [BuildContext] that:
|
||||
/// - has a [CupertinoTheme] whose [brightness] is [PlatformBrightness.light],
|
||||
/// or a [MediaQuery] whose [MediaQueryData.platformBrightness] is [PlatformBrightness.light].
|
||||
/// - has a [CupertinoTheme] whose [brightness] is [Brightness.light],
|
||||
/// or a [MediaQuery] whose [MediaQueryData.platformBrightness] is [Brightness.light].
|
||||
/// - has a [MediaQuery] whose [MediaQueryData.highContrast] is `true`.
|
||||
/// - has a [CupertinoUserInterfaceLevel] that indicates [CupertinoUserInterfaceLevelData.base].
|
||||
final Color highContrastColor;
|
||||
@ -823,8 +823,8 @@ class CupertinoDynamicColor extends Color with DiagnosticableMixin implements Di
|
||||
///
|
||||
/// In other words, this color will be the effective color of the [CupertinoDynamicColor]
|
||||
/// after it is resolved against a [BuildContext] that:
|
||||
/// - has a [CupertinoTheme] whose [brightness] is [PlatformBrightness.dark],
|
||||
/// or a [MediaQuery] whose [MediaQueryData.platformBrightness] is [PlatformBrightness.dark].
|
||||
/// - has a [CupertinoTheme] whose [brightness] is [Brightness.dark],
|
||||
/// or a [MediaQuery] whose [MediaQueryData.platformBrightness] is [Brightness.dark].
|
||||
/// - has a [MediaQuery] whose [MediaQueryData.highContrast] is `true`.
|
||||
/// - has a [CupertinoUserInterfaceLevel] that indicates [CupertinoUserInterfaceLevelData.base].
|
||||
final Color darkHighContrastColor;
|
||||
@ -834,8 +834,8 @@ class CupertinoDynamicColor extends Color with DiagnosticableMixin implements Di
|
||||
///
|
||||
/// In other words, this color will be the effective color of the [CupertinoDynamicColor]
|
||||
/// after it is resolved against a [BuildContext] that:
|
||||
/// - has a [CupertinoTheme] whose [brightness] is [PlatformBrightness.light],
|
||||
/// or a [MediaQuery] whose [MediaQueryData.platformBrightness] is [PlatformBrightness.light].
|
||||
/// - has a [CupertinoTheme] whose [brightness] is [Brightness.light],
|
||||
/// or a [MediaQuery] whose [MediaQueryData.platformBrightness] is [Brightness.light].
|
||||
/// - has a [MediaQuery] whose [MediaQueryData.highContrast] is `false`.
|
||||
/// - has a [CupertinoUserInterfaceLevel] that indicates [CupertinoUserInterfaceLevelData.elevated].
|
||||
final Color elevatedColor;
|
||||
@ -845,8 +845,8 @@ class CupertinoDynamicColor extends Color with DiagnosticableMixin implements Di
|
||||
///
|
||||
/// In other words, this color will be the effective color of the [CupertinoDynamicColor]
|
||||
/// after it is resolved against a [BuildContext] that:
|
||||
/// - has a [CupertinoTheme] whose [brightness] is [PlatformBrightness.dark],
|
||||
/// or a [MediaQuery] whose [MediaQueryData.platformBrightness] is [PlatformBrightness.dark].
|
||||
/// - has a [CupertinoTheme] whose [brightness] is [Brightness.dark],
|
||||
/// or a [MediaQuery] whose [MediaQueryData.platformBrightness] is [Brightness.dark].
|
||||
/// - has a [MediaQuery] whose [MediaQueryData.highContrast] is `false`.
|
||||
/// - has a [CupertinoUserInterfaceLevel] that indicates [CupertinoUserInterfaceLevelData.elevated].
|
||||
final Color darkElevatedColor;
|
||||
@ -856,8 +856,8 @@ class CupertinoDynamicColor extends Color with DiagnosticableMixin implements Di
|
||||
///
|
||||
/// In other words, this color will be the effective color of the [CupertinoDynamicColor]
|
||||
/// after it is resolved against a [BuildContext] that:
|
||||
/// - has a [CupertinoTheme] whose [brightness] is [PlatformBrightness.light],
|
||||
/// or a [MediaQuery] whose [MediaQueryData.platformBrightness] is [PlatformBrightness.light].
|
||||
/// - has a [CupertinoTheme] whose [brightness] is [Brightness.light],
|
||||
/// or a [MediaQuery] whose [MediaQueryData.platformBrightness] is [Brightness.light].
|
||||
/// - has a [MediaQuery] whose [MediaQueryData.highContrast] is `true`.
|
||||
/// - has a [CupertinoUserInterfaceLevel] that indicates [CupertinoUserInterfaceLevelData.elevated].
|
||||
final Color highContrastElevatedColor;
|
||||
@ -867,8 +867,8 @@ class CupertinoDynamicColor extends Color with DiagnosticableMixin implements Di
|
||||
///
|
||||
/// In other words, this color will be the effective color of the [CupertinoDynamicColor]
|
||||
/// after it is resolved against a [BuildContext] that:
|
||||
/// - has a [CupertinoTheme] whose [brightness] is [PlatformBrightness.dark],
|
||||
/// or a [MediaQuery] whose [MediaQueryData.platformBrightness] is [PlatformBrightness.dark].
|
||||
/// - has a [CupertinoTheme] whose [brightness] is [Brightness.dark],
|
||||
/// or a [MediaQuery] whose [MediaQueryData.platformBrightness] is [Brightness.dark].
|
||||
/// - has a [MediaQuery] whose [MediaQueryData.highContrast] is `true`.
|
||||
/// - has a [CupertinoUserInterfaceLevel] that indicates [CupertinoUserInterfaceLevelData.elevated].
|
||||
final Color darkHighContrastElevatedColor;
|
||||
@ -920,7 +920,7 @@ class CupertinoDynamicColor extends Color with DiagnosticableMixin implements Di
|
||||
///
|
||||
/// For example, if the given [BuildContext] indicates the widgets in the subtree
|
||||
/// should be displayed in dark mode (the surrounding [CupertinoTheme]'s [CupertinoThemeData.brightness]
|
||||
/// or [MediaQuery]'s [MediaQueryData.platformBrightness] is [PlatformBrightness.dark]),
|
||||
/// or [MediaQuery]'s [MediaQueryData.platformBrightness] is [Brightness.dark]),
|
||||
/// with a high accessibility contrast (the surrounding [MediaQuery]'s [MediaQueryData.highContrast]
|
||||
/// is `true`), and an elevated interface elevation (the surrounding [CupertinoUserInterfaceLevel]'s
|
||||
/// `data` is [CupertinoUserInterfaceLevelData.elevated]), the resolved
|
||||
|
@ -19,7 +19,7 @@ class CupertinoIconThemeData extends IconThemeData with DiagnosticableMixin {
|
||||
double size
|
||||
}) : super(color: color, opacity: opacity, size: size);
|
||||
|
||||
/// Called by [IconThemeData.of] to resolve [color] against the given [BuildContext].
|
||||
/// Called by [IconTheme.of] to resolve [color] against the given [BuildContext].
|
||||
@override
|
||||
IconThemeData resolve(BuildContext context) {
|
||||
final Color resolvedColor = CupertinoDynamicColor.resolve(color, context);
|
||||
|
@ -26,7 +26,7 @@ const double _kForegroundScreenOpacityFraction = 0.7;
|
||||
/// Displays its children widgets on a wheel for selection and
|
||||
/// calls back when the currently selected item changes.
|
||||
///
|
||||
/// By default, the first child in [children] will be the initially selected child.
|
||||
/// By default, the first child in `children` will be the initially selected child.
|
||||
/// The index of a different child can be specified in [scrollController], to make
|
||||
/// that child the initially selected child.
|
||||
///
|
||||
|
@ -883,8 +883,8 @@ class _CupertinoModalPopupRoute<T> extends PopupRoute<T> {
|
||||
///
|
||||
/// See also:
|
||||
///
|
||||
/// * [ActionSheet], which is the widget usually returned by the `builder`
|
||||
/// argument to [showCupertinoModalPopup].
|
||||
/// * [CupertinoActionSheet], which is the widget usually returned by the
|
||||
/// `builder` argument to [showCupertinoModalPopup].
|
||||
/// * <https://developer.apple.com/design/human-interface-guidelines/ios/views/action-sheets/>
|
||||
Future<T> showCupertinoModalPopup<T>({
|
||||
@required BuildContext context,
|
||||
|
@ -119,7 +119,7 @@ class CupertinoTabController extends ChangeNotifier {
|
||||
///
|
||||
/// Tabs' contents are built with the provided [tabBuilder] at the active
|
||||
/// tab index. The [tabBuilder] must be able to build the same number of
|
||||
/// pages as there are [tabBar.items]. Inactive tabs will be moved [Offstage]
|
||||
/// pages as there are [tabBar] items. Inactive tabs will be moved [Offstage]
|
||||
/// and their animations disabled.
|
||||
///
|
||||
/// Adding/removing tabs, or changing the order of tabs is supported but not
|
||||
@ -280,7 +280,7 @@ class CupertinoTabScaffold extends StatefulWidget {
|
||||
/// By default uses [CupertinoTheme]'s `scaffoldBackgroundColor` when null.
|
||||
final Color backgroundColor;
|
||||
|
||||
/// Whether the [child] should size itself to avoid the window's bottom inset.
|
||||
/// Whether the body should size itself to avoid the window's bottom inset.
|
||||
///
|
||||
/// For example, if there is an onscreen keyboard displayed above the
|
||||
/// scaffold, the body can be resized to avoid overlapping the keyboard, which
|
||||
|
@ -165,8 +165,8 @@ class _CupertinoTextFieldSelectionGestureDetectorBuilder extends TextSelectionGe
|
||||
/// rounded rectangle border around the text field. If you set the [decoration]
|
||||
/// property to null, the decoration will be removed entirely.
|
||||
///
|
||||
/// Remember to [dispose] of the [TextEditingController] when it is no longer needed.
|
||||
/// This will ensure we discard any resources used by the object.
|
||||
/// Remember to call [TextEditingController.dispose] when it is no longer
|
||||
/// needed. This will ensure we discard any resources used by the object.
|
||||
///
|
||||
/// See also:
|
||||
///
|
||||
@ -400,7 +400,7 @@ class CupertinoTextField extends StatefulWidget {
|
||||
/// paste and cut will be disabled regardless.
|
||||
final ToolbarOptions toolbarOptions;
|
||||
|
||||
/// {@macro flutter.material.inputDecorator.textAlignVertical}
|
||||
/// {@macro flutter.widgets.inputDecorator.textAlignVertical}
|
||||
final TextAlignVertical textAlignVertical;
|
||||
|
||||
/// {@macro flutter.widgets.editableText.readOnly}
|
||||
@ -539,7 +539,7 @@ class CupertinoTextField extends StatefulWidget {
|
||||
/// {@macro flutter.widgets.editableText.scrollController}
|
||||
final ScrollController scrollController;
|
||||
|
||||
/// {@macro flutter.widgets.edtiableText.scrollPhysics}
|
||||
/// {@macro flutter.widgets.editableText.scrollPhysics}
|
||||
final ScrollPhysics scrollPhysics;
|
||||
|
||||
/// {@macro flutter.rendering.editable.selectionEnabled}
|
||||
|
@ -182,7 +182,7 @@ class ErrorHint extends _ErrorDiagnostic {
|
||||
/// An [ErrorSpacer] creates an empty [DiagnosticsNode], that can be used to
|
||||
/// tune the spacing between other [DiagnosticsNode] objects.
|
||||
class ErrorSpacer extends DiagnosticsProperty<void> {
|
||||
/// Creates an empty space to insert into a list of [DiagnosticNode] objects
|
||||
/// Creates an empty space to insert into a list of [DiagnosticsNode] objects
|
||||
/// typically within a [FlutterError] object.
|
||||
ErrorSpacer() : super(
|
||||
'',
|
||||
@ -516,7 +516,7 @@ class FlutterError extends Error with DiagnosticableTreeMixin implements Asserti
|
||||
|
||||
/// Create an error message from a list of [DiagnosticsNode]s.
|
||||
///
|
||||
/// By convention, there should be exactly one [FlutterSummary] in the list,
|
||||
/// By convention, there should be exactly one [ErrorSummary] in the list,
|
||||
/// and it should be the first entry.
|
||||
///
|
||||
/// Other entries are typically [ErrorDescription]s (for material that is
|
||||
@ -774,11 +774,6 @@ void debugPrintStack({StackTrace stackTrace, String label, int maxFrames}) {
|
||||
|
||||
/// Diagnostic with a [StackTrace] [value] suitable for displaying stack traces
|
||||
/// as part of a [FlutterError] object.
|
||||
///
|
||||
/// See also:
|
||||
///
|
||||
/// * [FlutterErrorBuilder.addStackTrace], which is the typical way [StackTrace]
|
||||
/// objects are added to a [FlutterError].
|
||||
class DiagnosticsStackTrace extends DiagnosticsBlock {
|
||||
/// Creates a diagnostic for a stack trace.
|
||||
///
|
||||
|
@ -166,8 +166,8 @@ enum DiagnosticsTreeStyle {
|
||||
///
|
||||
/// See also:
|
||||
///
|
||||
/// * [DebugOverflowIndicator], which uses this style to display just the
|
||||
/// immediate children of a node.
|
||||
/// * [DebugOverflowIndicatorMixin], which uses this style to display just
|
||||
/// the immediate children of a node.
|
||||
shallow,
|
||||
|
||||
/// Render only the children of a node truncating before the tree becomes too
|
||||
@ -326,9 +326,6 @@ class TextTreeConfiguration {
|
||||
|
||||
/// Mandatory string to add after the properties of a node regardless of
|
||||
/// whether the node has any properties.
|
||||
///
|
||||
/// See [headerLineTextConfiguration] for an example of using this field to
|
||||
/// add a colon at the end of the header line.
|
||||
final String mandatoryAfterProperties;
|
||||
|
||||
/// Property separator to add between properties.
|
||||
@ -1061,7 +1058,7 @@ bool _isSingleLine(DiagnosticsTreeStyle style) {
|
||||
///
|
||||
/// See also:
|
||||
///
|
||||
/// * [DiagnosticsNode.toStringDeep], which uses a [TextRender] to return a
|
||||
/// * [DiagnosticsNode.toStringDeep], which uses a [TextTreeRenderer] to return a
|
||||
/// string representation of this node and its descendants.
|
||||
class TextTreeRenderer {
|
||||
/// Creates a [TextTreeRenderer] object with the given arguments specifying
|
||||
|
@ -25,7 +25,7 @@ typedef _ComputeImpl = Future<R> Function<Q, R>(ComputeCallback<Q, R> callback,
|
||||
///
|
||||
/// This is useful for operations that take longer than a few milliseconds, and
|
||||
/// which would therefore risk skipping frames. For tasks that will only take a
|
||||
/// few milliseconds, consider [scheduleTask] instead.
|
||||
/// few milliseconds, consider [SchedulerBinding.scheduleTask] instead.
|
||||
///
|
||||
/// {@template flutter.foundation.compute.types}
|
||||
/// `Q` is the type of the message that kicks off the computation.
|
||||
|
@ -115,7 +115,7 @@ enum _LicenseEntryWithLineBreaksParserState {
|
||||
/// license per frame is reasonable; doing more at the same time is ill-advised.
|
||||
/// Consider doing all the work at once using [compute] to move the work to
|
||||
/// another thread, or spreading the work across multiple frames using
|
||||
/// [scheduleTask].
|
||||
/// [SchedulerBinding.scheduleTask].
|
||||
class LicenseEntryWithLineBreaks extends LicenseEntry {
|
||||
/// Create a license entry for a license whose text is hard-wrapped within
|
||||
/// paragraphs and has paragraph breaks denoted by blank lines or with
|
||||
|
@ -13,7 +13,7 @@ import '_platform_io.dart'
|
||||
/// platform for styling purposes, rather than using [defaultTargetPlatform].
|
||||
/// Widgets and render objects at lower layers that try to emulate the
|
||||
/// underlying platform can depend on [defaultTargetPlatform] directly. The
|
||||
/// [dart.io.Platform] object should only be used directly when it's critical to
|
||||
/// [dart:io.Platform] object should only be used directly when it's critical to
|
||||
/// actually know the current platform, without any overrides possible (for
|
||||
/// example, when a system API is about to be called).
|
||||
///
|
||||
|
@ -257,11 +257,10 @@ abstract class PointerEvent extends Diagnosticable {
|
||||
/// system according to [transform].
|
||||
///
|
||||
/// If this event has not been transformed, [position] is returned as-is.
|
||||
///
|
||||
/// See also:
|
||||
///
|
||||
/// * [globalPosition], which is the position in the global coordinate
|
||||
/// system of the screen.
|
||||
/// * [position], which is the position in the global coordinate system of
|
||||
/// the screen.
|
||||
final Offset localPosition;
|
||||
|
||||
/// Distance in logical pixels that the pointer moved since the last
|
||||
@ -420,7 +419,7 @@ abstract class PointerEvent extends Diagnosticable {
|
||||
/// Set if the event was synthesized by Flutter.
|
||||
///
|
||||
/// We occasionally synthesize PointerEvents that aren't exact translations
|
||||
/// of [ui.PointerData] from the engine to cover small cross-OS discrepancies
|
||||
/// of [PointerData] from the engine to cover small cross-OS discrepancies
|
||||
/// in pointer behaviors.
|
||||
///
|
||||
/// For instance, on end events, Android always drops any location changes
|
||||
|
@ -43,7 +43,6 @@ enum _ForceState {
|
||||
/// * [ForcePressGestureRecognizer.onStart], [ForcePressGestureRecognizer.onPeak],
|
||||
/// [ForcePressGestureRecognizer.onEnd], and [ForcePressGestureRecognizer.onUpdate]
|
||||
/// which use [ForcePressDetails].
|
||||
/// * [ForcePressUpdateDetails], the details for [ForcePressUpdateCallback].
|
||||
class ForcePressDetails {
|
||||
/// Creates details for a [GestureForcePressStartCallback],
|
||||
/// [GestureForcePressPeakCallback] or [GestureForcePressEndCallback].
|
||||
@ -152,7 +151,7 @@ class ForcePressGestureRecognizer extends OneSequenceGestureRecognizer {
|
||||
/// of [onStart] and/or [onPeak] and before the invocation of [onEnd], no
|
||||
/// matter what the pressure is during this time period. The position and
|
||||
/// pressure of the pointer is provided in the callback's `details` argument,
|
||||
/// which is a [ForcePressUpdateDetails] object.
|
||||
/// which is a [ForcePressDetails] object.
|
||||
GestureForcePressUpdateCallback onUpdate;
|
||||
|
||||
/// A pointer is in contact with the screen and has just pressed with a force
|
||||
@ -190,7 +189,7 @@ class ForcePressGestureRecognizer extends OneSequenceGestureRecognizer {
|
||||
///
|
||||
/// This function must always return values in the range 0.0 to 1.0 given a
|
||||
/// pressure that is between the minimum and maximum pressures. It may return
|
||||
/// [double.NaN] for values that it does not want to support.
|
||||
/// `double.NaN` for values that it does not want to support.
|
||||
///
|
||||
/// By default, the function is a linear interpolation; however, changing the
|
||||
/// function could be useful to accommodate variations in the way different
|
||||
|
@ -62,8 +62,8 @@ class HitTestEntry {
|
||||
///
|
||||
/// See also:
|
||||
///
|
||||
/// * [HitTestResult.addWithPaintTransform], which is used during hit testing
|
||||
/// to build up the transform returned by this method.
|
||||
/// * [HitTestResult.pushTransform], which is used during hit
|
||||
/// testing to build up the transform returned by this method.
|
||||
Matrix4 get transform => _transform;
|
||||
Matrix4 _transform;
|
||||
}
|
||||
@ -129,7 +129,7 @@ class HitTestResult {
|
||||
/// * [BoxHitTestResult.addWithPaintTransform], which is a public wrapper
|
||||
/// around this function for hit testing on [RenderBox]s.
|
||||
/// * [SliverHitTestResult.addWithAxisOffset], which is a public wrapper
|
||||
/// around this function for hit testing on [RenderSlivers]s.
|
||||
/// around this function for hit testing on [RenderSliver]s.
|
||||
@protected
|
||||
void pushTransform(Matrix4 transform) {
|
||||
assert(transform != null);
|
||||
|
@ -106,7 +106,7 @@ class MouseTrackerAnnotation {
|
||||
/// annotation is attached, then you can call the callback when that
|
||||
/// condition goes from true to false.
|
||||
/// * In the cases where the solutions above won't work, you can always
|
||||
/// override [Widget.dispose] or [RenderObject.detach].
|
||||
/// override [State.dispose] or [RenderObject.detach].
|
||||
/// {@endtemplate}
|
||||
///
|
||||
/// Technically, whether [onExit] will be called is controlled by
|
||||
|
@ -144,8 +144,8 @@ class DoubleTapGestureRecognizer extends GestureRecognizer {
|
||||
/// Called when the user has tapped the screen with a primary button at the
|
||||
/// same location twice in quick succession.
|
||||
///
|
||||
/// This triggers when the pointer stops contacting the device after the 2nd tap,
|
||||
/// immediately after [onDoubleTapUp].
|
||||
/// This triggers when the pointer stops contacting the device after the
|
||||
/// second tap.
|
||||
///
|
||||
/// See also:
|
||||
///
|
||||
|
@ -390,7 +390,7 @@ class TapGestureRecognizer extends BaseTapGestureRecognizer {
|
||||
/// See also:
|
||||
///
|
||||
/// * [kSecondaryButton], the button this callback responds to.
|
||||
/// * [onPrimaryTapDown], a similar callback but for a primary button.
|
||||
/// * [onTapDown], a similar callback but for a primary button.
|
||||
/// * [TapDownDetails], which is passed as an argument to this callback.
|
||||
/// * [GestureDetector.onSecondaryTapDown], which exposes this callback.
|
||||
GestureTapDownCallback onSecondaryTapDown;
|
||||
@ -407,7 +407,7 @@ class TapGestureRecognizer extends BaseTapGestureRecognizer {
|
||||
/// See also:
|
||||
///
|
||||
/// * [kSecondaryButton], the button this callback responds to.
|
||||
/// * [onPrimaryTapUp], a similar callback but for a primary button.
|
||||
/// * [onTapUp], a similar callback but for a primary button.
|
||||
/// * [TapUpDetails], which is passed as an argument to this callback.
|
||||
/// * [GestureDetector.onSecondaryTapUp], which exposes this callback.
|
||||
GestureTapUpCallback onSecondaryTapUp;
|
||||
@ -423,7 +423,7 @@ class TapGestureRecognizer extends BaseTapGestureRecognizer {
|
||||
/// See also:
|
||||
///
|
||||
/// * [kSecondaryButton], the button this callback responds to.
|
||||
/// * [onPrimaryTapCancel], a similar callback but for a primary button.
|
||||
/// * [onTapCancel], a similar callback but for a primary button.
|
||||
/// * [GestureDetector.onTapCancel], which exposes this callback.
|
||||
GestureTapCancelCallback onSecondaryTapCancel;
|
||||
|
||||
|
@ -112,7 +112,7 @@ class _CombiningGestureArenaMember extends GestureArenaMember {
|
||||
///
|
||||
/// [AndroidView] uses a team with a captain to decide which gestures are
|
||||
/// forwarded to the native view. For example if we want to forward taps and
|
||||
/// vertical scrolls to a native Android view, [TapGestureRecognizers] and
|
||||
/// vertical scrolls to a native Android view, [TapGestureRecognizer]s and
|
||||
/// [VerticalDragGestureRecognizer] are added to a team with a captain(the captain is set to be a
|
||||
/// gesture recognizer that never explicitly claims the gesture).
|
||||
/// The captain allows [AndroidView] to know when any gestures in the team has been
|
||||
|
@ -35,9 +35,7 @@ import 'theme.dart';
|
||||
///
|
||||
/// See also:
|
||||
///
|
||||
/// * [ComputeNotch] a function used for creating a notch in a shape.
|
||||
/// * [ScaffoldGeometry.floatingActionBarComputeNotch] the [ComputeNotch] used to
|
||||
/// make a notch for the [FloatingActionButton].
|
||||
/// * [NotchedShape] which calculates the notch for a notched [BottomAppBar].
|
||||
/// * [FloatingActionButton] which the [BottomAppBar] makes a notch for.
|
||||
/// * [AppBar] for a toolbar that is shown at the top of the screen.
|
||||
class BottomAppBar extends StatefulWidget {
|
||||
|
@ -25,7 +25,7 @@ import 'raised_button.dart';
|
||||
/// widget, it aligns its buttons in a column. The key difference here
|
||||
/// is that the [MainAxisAlignment] will then be treated as a
|
||||
/// cross-axis/horizontal alignment. For example, if the buttons overflow and
|
||||
/// [ButtonBar.alignment] was set to [MainAxisAligment.start], the buttons would
|
||||
/// [ButtonBar.alignment] was set to [MainAxisAlignment.start], the buttons would
|
||||
/// align to the horizontal start of the button bar.
|
||||
///
|
||||
/// The [ButtonBar] can be configured with a [ButtonBarTheme]. For any null
|
||||
|
@ -23,7 +23,7 @@ import 'theme_data.dart';
|
||||
/// rebuilt if the theme later changes.
|
||||
///
|
||||
/// The [ThemeData] object given by the [Theme.of] call also contains a default
|
||||
/// [Theme.chipTheme] that can be customized by copying it (using
|
||||
/// [ThemeData.chipTheme] that can be customized by copying it (using
|
||||
/// [ChipThemeData.copyWith]).
|
||||
///
|
||||
/// See also:
|
||||
|
@ -18,8 +18,8 @@ import 'theme.dart';
|
||||
/// When Shape is `null`, the dialog defaults to a [RoundedRectangleBorder] with
|
||||
/// a border radius of 2.0 on all corners.
|
||||
///
|
||||
/// [titleTextStyle] and [contentTextStyle] are used in [AlertDialogs].
|
||||
/// If null, they default to [ThemeData.textTheme.title] and [ThemeData.textTheme.subhead],
|
||||
/// [titleTextStyle] and [contentTextStyle] are used in [AlertDialog]s.
|
||||
/// If null, they default to [TextTheme.title] and [TextTheme.subhead],
|
||||
/// respectively.
|
||||
///
|
||||
/// See also:
|
||||
|
@ -130,11 +130,11 @@ class DividerThemeData extends Diagnosticable {
|
||||
}
|
||||
|
||||
/// An inherited widget that defines the configuration for
|
||||
/// [Divider]s, [VerticalDividers]s, dividers between [ListTile]s, and dividers
|
||||
/// [Divider]s, [VerticalDivider]s, dividers between [ListTile]s, and dividers
|
||||
/// between rows in [DataTable]s in this widget's subtree.
|
||||
class DividerTheme extends InheritedTheme {
|
||||
/// Creates a divider theme that controls the configurations for
|
||||
/// [Divider]s, [VerticalDividers]s, dividers between [ListTile]s, and dividers
|
||||
/// [Divider]s, [VerticalDivider]s, dividers between [ListTile]s, and dividers
|
||||
/// between rows in [DataTable]s in its widget subtree.
|
||||
const DividerTheme({
|
||||
Key key,
|
||||
@ -143,7 +143,7 @@ class DividerTheme extends InheritedTheme {
|
||||
}) : assert(data != null),
|
||||
super(key: key, child: child);
|
||||
|
||||
/// The properties for descendant [Divider]s, [VerticalDividers]s, dividers
|
||||
/// The properties for descendant [Divider]s, [VerticalDivider]s, dividers
|
||||
/// between [ListTile]s, and dividers between rows in [DataTable]s.
|
||||
final DividerThemeData data;
|
||||
|
||||
|
@ -23,7 +23,7 @@ import 'package:flutter/widgets.dart';
|
||||
///
|
||||
/// {@tool sample}
|
||||
/// This example shows how to create a [Row] of [Icon]s in different colors and
|
||||
/// sizes. The first [Icon] uses a [semanticLabel] to announce in accessibility
|
||||
/// sizes. The first [Icon] uses a [Icon.semanticLabel] to announce in accessibility
|
||||
/// modes like TalkBack and VoiceOver.
|
||||
///
|
||||
/// 
|
||||
|
@ -177,7 +177,7 @@ abstract class MaterialLocalizations {
|
||||
/// Defines the localized [TextStyle] geometry for [ThemeData.textTheme].
|
||||
///
|
||||
/// The [scriptCategory] defines the overall geometry of a [TextTheme] for
|
||||
/// the static [MaterialTextGeometry.localizedFor] method in terms of the
|
||||
/// the [Typography.geometryThemeFor] method in terms of the
|
||||
/// three language categories defined in https://material.io/go/design-typography.
|
||||
///
|
||||
/// Generally speaking, font sizes for [ScriptCategory.tall] and
|
||||
@ -353,7 +353,7 @@ class _MaterialLocalizationsDelegate extends LocalizationsDelegate<MaterialLocal
|
||||
///
|
||||
/// * [GlobalMaterialLocalizations], which provides material localizations for
|
||||
/// many languages.
|
||||
/// * [MaterialApp.delegates], which automatically includes
|
||||
/// * [MaterialApp.localizationsDelegates], which automatically includes
|
||||
/// [DefaultMaterialLocalizations.delegate] by default.
|
||||
class DefaultMaterialLocalizations implements MaterialLocalizations {
|
||||
/// Constructs an object that defines the material widgets' localized strings
|
||||
|
@ -311,7 +311,7 @@ class __ZoomPageTransitionState extends State<_ZoomPageTransition> {
|
||||
/// Used by [PageTransitionsTheme] to define a [MaterialPageRoute] page
|
||||
/// transition animation.
|
||||
///
|
||||
/// Apps can configure the map of builders for [ThemeData.platformTheme]
|
||||
/// Apps can configure the map of builders for [ThemeData.pageTransitionsTheme]
|
||||
/// to customize the default [MaterialPageRoute] page transition animation
|
||||
/// for different platforms.
|
||||
///
|
||||
|
@ -376,7 +376,7 @@ class SelectableText extends StatefulWidget {
|
||||
/// selectable text's internal gesture detector, use a [Listener].
|
||||
final GestureTapCallback onTap;
|
||||
|
||||
/// {@macro flutter.widgets.edtiableText.scrollPhysics}
|
||||
/// {@macro flutter.widgets.editableText.scrollPhysics}
|
||||
final ScrollPhysics scrollPhysics;
|
||||
|
||||
/// {@macro flutter.painting.textPainter.textWidthBasis}
|
||||
|
@ -444,7 +444,7 @@ class TextField extends StatefulWidget {
|
||||
/// {@macro flutter.widgets.editableText.textAlign}
|
||||
final TextAlign textAlign;
|
||||
|
||||
/// {@macro flutter.material.inputDecorator.textAlignVertical}
|
||||
/// {@macro flutter.widgets.inputDecorator.textAlignVertical}
|
||||
final TextAlignVertical textAlignVertical;
|
||||
|
||||
/// {@macro flutter.widgets.editableText.textDirection}
|
||||
@ -663,7 +663,7 @@ class TextField extends StatefulWidget {
|
||||
/// {@end-tool}
|
||||
final InputCounterWidgetBuilder buildCounter;
|
||||
|
||||
/// {@macro flutter.widgets.edtiableText.scrollPhysics}
|
||||
/// {@macro flutter.widgets.editableText.scrollPhysics}
|
||||
final ScrollPhysics scrollPhysics;
|
||||
|
||||
/// {@macro flutter.widgets.editableText.scrollController}
|
||||
|
@ -12,7 +12,7 @@ import 'text_theme.dart';
|
||||
/// its localized [TextStyle] geometry for [ThemeData.textTheme].
|
||||
///
|
||||
/// The script category defines the overall geometry of a [TextTheme] for
|
||||
/// the static [MaterialTextGeometry.localizedFor] method in terms of the
|
||||
/// the [Typography.geometryThemeFor] method in terms of the
|
||||
/// three language categories defined in <https://material.io/go/design-typography>.
|
||||
///
|
||||
/// Generally speaking, font sizes for [ScriptCategory.tall] and
|
||||
|
@ -2702,7 +2702,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
|
||||
///
|
||||
/// If [isSemanticBoundary] is true, this method is called with the `node`
|
||||
/// created for this [RenderObject], the `config` to be applied to that node
|
||||
/// and the `children` [SemanticNode]s that descendants of this RenderObject
|
||||
/// and the `children` [SemanticsNode]s that descendants of this RenderObject
|
||||
/// have generated.
|
||||
///
|
||||
/// By default, the method will annotate `node` with `config` and add the
|
||||
@ -3419,7 +3419,7 @@ abstract class _InterestingSemanticsFragment extends _SemanticsFragment {
|
||||
_ancestorChain = <RenderObject>[owner],
|
||||
super(dropsSemanticsOfPreviousSiblings: dropsSemanticsOfPreviousSiblings);
|
||||
|
||||
/// The [RenderObject] that owns this fragment (and any new [SemanticNode]
|
||||
/// The [RenderObject] that owns this fragment (and any new [SemanticsNode]
|
||||
/// introduced by it).
|
||||
RenderObject get owner => _ancestorChain.first;
|
||||
|
||||
|
@ -3636,15 +3636,16 @@ class RenderSemanticsAnnotations extends RenderProxyBox {
|
||||
/// Whether descendants of this [RenderObject] are allowed to add semantic
|
||||
/// information to the [SemanticsNode] annotated by this widget.
|
||||
///
|
||||
/// When set to false descendants are allowed to annotate [SemanticNode]s of
|
||||
/// When set to false descendants are allowed to annotate [SemanticsNode]s of
|
||||
/// their parent with the semantic information they want to contribute to the
|
||||
/// semantic tree.
|
||||
/// When set to true the only way for descendants to contribute semantic
|
||||
/// information to the semantic tree is to introduce new explicit
|
||||
/// [SemanticNode]s to the tree.
|
||||
/// [SemanticsNode]s to the tree.
|
||||
///
|
||||
/// This setting is often used in combination with [isSemanticBoundary] to
|
||||
/// create semantic boundaries that are either writable or not for children.
|
||||
/// This setting is often used in combination with
|
||||
/// [SemanticsConfiguration.isSemanticBoundary] to create semantic boundaries
|
||||
/// that are either writable or not for children.
|
||||
bool get explicitChildNodes => _explicitChildNodes;
|
||||
bool _explicitChildNodes;
|
||||
set explicitChildNodes(bool value) {
|
||||
@ -3671,8 +3672,8 @@ class RenderSemanticsAnnotations extends RenderProxyBox {
|
||||
markNeedsSemanticsUpdate();
|
||||
}
|
||||
|
||||
/// If non-null, sets the [SemanticsNode.hasCheckedState] semantic to true and
|
||||
/// the [SemanticsNode.isChecked] semantic to the given value.
|
||||
/// If non-null, sets the [SemanticsFlag.hasCheckedState] semantic to true and
|
||||
/// the [SemanticsConfiguration.isChecked] semantic to the given value.
|
||||
bool get checked => _checked;
|
||||
bool _checked;
|
||||
set checked(bool value) {
|
||||
@ -3682,8 +3683,8 @@ class RenderSemanticsAnnotations extends RenderProxyBox {
|
||||
markNeedsSemanticsUpdate();
|
||||
}
|
||||
|
||||
/// If non-null, sets the [SemanticsNode.hasEnabledState] semantic to true and
|
||||
/// the [SemanticsNode.isEnabled] semantic to the given value.
|
||||
/// If non-null, sets the [SemanticsFlag.hasEnabledState] semantic to true and
|
||||
/// the [SemanticsConfiguration.isEnabled] semantic to the given value.
|
||||
bool get enabled => _enabled;
|
||||
bool _enabled;
|
||||
set enabled(bool value) {
|
||||
@ -3693,8 +3694,8 @@ class RenderSemanticsAnnotations extends RenderProxyBox {
|
||||
markNeedsSemanticsUpdate();
|
||||
}
|
||||
|
||||
/// If non-null, sets the [SemanticsNode.isSelected] semantic to the given
|
||||
/// value.
|
||||
/// If non-null, sets the [SemanticsConfiguration.isSelected] semantic to the
|
||||
/// given value.
|
||||
bool get selected => _selected;
|
||||
bool _selected;
|
||||
set selected(bool value) {
|
||||
@ -3704,7 +3705,8 @@ class RenderSemanticsAnnotations extends RenderProxyBox {
|
||||
markNeedsSemanticsUpdate();
|
||||
}
|
||||
|
||||
/// If non-null, sets the [SemanticsNode.isButton] semantic to the given value.
|
||||
/// If non-null, sets the [SemanticsConfiguration.isButton] semantic to the
|
||||
/// given value.
|
||||
bool get button => _button;
|
||||
bool _button;
|
||||
set button(bool value) {
|
||||
@ -3848,7 +3850,7 @@ class RenderSemanticsAnnotations extends RenderProxyBox {
|
||||
_image = value;
|
||||
}
|
||||
|
||||
/// If non-null, sets the [SemanticsNode.isLiveRegion] semantic to the given
|
||||
/// If non-null, sets the [SemanticsFlag.isLiveRegion] semantic to the given
|
||||
/// value.
|
||||
bool get liveRegion => _liveRegion;
|
||||
bool _liveRegion;
|
||||
|
@ -417,7 +417,8 @@ mixin SchedulerBinding on BindingBase, ServicesBinding {
|
||||
// Whether this scheduler already requested to be called from the event loop.
|
||||
bool _hasRequestedAnEventLoopCallback = false;
|
||||
|
||||
// Ensures that the scheduler services a task scheduled by [scheduleTask].
|
||||
// Ensures that the scheduler services a task scheduled by
|
||||
// [SchedulerBinding.scheduleTask].
|
||||
void _ensureEventLoopCallback() {
|
||||
assert(!locked);
|
||||
assert(_taskQueue.isNotEmpty);
|
||||
|
@ -2776,11 +2776,11 @@ class SemanticsConfiguration {
|
||||
/// so in the form of explicit [SemanticsNode]s.
|
||||
///
|
||||
/// When set to false children of the owning [RenderObject] are allowed to
|
||||
/// annotate [SemanticNode]s of their parent with the semantic information
|
||||
/// annotate [SemanticsNode]s of their parent with the semantic information
|
||||
/// they want to contribute to the semantic tree.
|
||||
/// When set to true the only way for children of the owning [RenderObject]
|
||||
/// to contribute semantic information to the semantic tree is to introduce
|
||||
/// new explicit [SemanticNode]s to the tree.
|
||||
/// new explicit [SemanticsNode]s to the tree.
|
||||
///
|
||||
/// This setting is often used in combination with [isSemanticBoundary] to
|
||||
/// create semantic boundaries that are either writable or not for children.
|
||||
@ -2804,7 +2804,7 @@ class SemanticsConfiguration {
|
||||
bool isBlockingSemanticsOfPreviouslyPaintedNodes = false;
|
||||
|
||||
// SEMANTIC ANNOTATIONS
|
||||
// These will end up on [SemanticNode]s generated from
|
||||
// These will end up on [SemanticsNode]s generated from
|
||||
// [SemanticsConfiguration]s.
|
||||
|
||||
/// Whether this configuration is empty.
|
||||
|
@ -49,6 +49,7 @@ export 'dart:ui' show Locale;
|
||||
/// is recommended over [LocaleResolutionCallback].
|
||||
typedef LocaleListResolutionCallback = Locale Function(List<Locale> locales, Iterable<Locale> supportedLocales);
|
||||
|
||||
/// {@template flutter.widgets.widgetsApp.localeResolutionCallback}
|
||||
/// The signature of [WidgetsApp.localeResolutionCallback].
|
||||
///
|
||||
/// It is recommended to provide a [LocaleListResolutionCallback] instead of a
|
||||
@ -73,6 +74,7 @@ typedef LocaleListResolutionCallback = Locale Function(List<Locale> locales, Ite
|
||||
///
|
||||
/// * [LocaleListResolutionCallback], which takes a list of preferred locales (instead of one locale).
|
||||
/// Resolutions by [LocaleListResolutionCallback] take precedence over [LocaleResolutionCallback].
|
||||
/// {@endtemplate}
|
||||
typedef LocaleResolutionCallback = Locale Function(Locale locale, Iterable<Locale> supportedLocales);
|
||||
|
||||
/// The signature of [WidgetsApp.onGenerateTitle].
|
||||
@ -487,7 +489,7 @@ class WidgetsApp extends StatefulWidget {
|
||||
///
|
||||
/// The value of [Localizations.locale] will equal this locale if
|
||||
/// it matches one of the [supportedLocales]. Otherwise it will be
|
||||
/// the first [supportedLocale].
|
||||
/// the first element of [supportedLocales].
|
||||
/// {@endtemplate}
|
||||
///
|
||||
/// See also:
|
||||
@ -511,22 +513,25 @@ class WidgetsApp extends StatefulWidget {
|
||||
/// when the app is started, and when the user changes the
|
||||
/// device's locale.
|
||||
///
|
||||
/// When a [localeListResolutionCallback] is provided, Flutter will first attempt to
|
||||
/// resolve the locale with the provided [localeListResolutionCallback]. If the
|
||||
/// callback or result is null, it will fallback to trying the [localeResolutionCallback].
|
||||
/// If both [localeResolutionCallback] and [localeListResolutionCallback] are left null
|
||||
/// or fail to resolve (return null), the [WidgetsApp.basicLocaleListResolution]
|
||||
/// fallback algorithm will be used.
|
||||
/// When a [localeListResolutionCallback] is provided, Flutter will first
|
||||
/// attempt to resolve the locale with the provided
|
||||
/// [localeListResolutionCallback]. If the callback or result is null, it will
|
||||
/// fallback to trying the [localeResolutionCallback]. If both
|
||||
/// [localeResolutionCallback] and [localeListResolutionCallback] are left
|
||||
/// null or fail to resolve (return null), the a basic fallback algorithm will
|
||||
/// be used.
|
||||
///
|
||||
/// The priority of each available fallback is:
|
||||
///
|
||||
/// 1. [localeListResolutionCallback] is attempted first.
|
||||
/// 2. [localeResolutionCallback] is attempted second.
|
||||
/// 3. Flutter's [WidgetsApp.basicLocaleListResolution] algorithm is attempted last.
|
||||
/// 1. [localeResolutionCallback] is attempted second.
|
||||
/// 1. Flutter's basic resolution algorithm, as described in
|
||||
/// [supportedLocales], is attempted last.
|
||||
///
|
||||
/// Properly localized projects should provide a more advanced algorithm than
|
||||
/// [basicLocaleListResolution] as it does not implement a complete algorithm
|
||||
/// (such as the one defined in [Unicode TR35](https://unicode.org/reports/tr35/#LanguageMatching))
|
||||
/// the basic method from [supportedLocales], as it does not implement a
|
||||
/// complete algorithm (such as the one defined in
|
||||
/// [Unicode TR35](https://unicode.org/reports/tr35/#LanguageMatching))
|
||||
/// and is optimized for speed at the detriment of some uncommon edge-cases.
|
||||
/// {@endtemplate}
|
||||
///
|
||||
@ -539,8 +544,6 @@ class WidgetsApp extends StatefulWidget {
|
||||
///
|
||||
/// * [MaterialApp.localeListResolutionCallback], which sets the callback of the
|
||||
/// [WidgetsApp] it creates.
|
||||
/// * [basicLocaleListResolution], a static method that implements the locale resolution
|
||||
/// algorithm that is used when no custom locale resolution algorithm is provided.
|
||||
final LocaleListResolutionCallback localeListResolutionCallback;
|
||||
|
||||
/// {@macro flutter.widgets.widgetsApp.localeListResolutionCallback}
|
||||
@ -556,8 +559,6 @@ class WidgetsApp extends StatefulWidget {
|
||||
///
|
||||
/// * [MaterialApp.localeResolutionCallback], which sets the callback of the
|
||||
/// [WidgetsApp] it creates.
|
||||
/// * [basicLocaleListResolution], a static method that implements the locale resolution
|
||||
/// algorithm that is used when no custom locale resolution algorithm is provided.
|
||||
final LocaleResolutionCallback localeResolutionCallback;
|
||||
|
||||
/// {@template flutter.widgets.widgetsApp.supportedLocales}
|
||||
@ -570,24 +571,24 @@ class WidgetsApp extends StatefulWidget {
|
||||
/// `[const Locale('en', 'US')]`.
|
||||
///
|
||||
/// The order of the list matters. The default locale resolution algorithm,
|
||||
/// [basicLocaleListResolution], attempts to match by the following priority:
|
||||
/// `basicLocaleListResolution`, attempts to match by the following priority:
|
||||
///
|
||||
/// 1. [Locale.languageCode], [Locale.scriptCode], and [Locale.countryCode]
|
||||
/// 2. [Locale.languageCode] and [Locale.countryCode] only
|
||||
/// 3. [Locale.languageCode] and [Locale.countryCode] only
|
||||
/// 4. [Locale.languageCode] only
|
||||
/// 6. [Locale.countryCode] only when all [preferredLocales] fail to match
|
||||
/// 5. returns [supportedLocales.first] as a fallback
|
||||
/// 1. [Locale.languageCode] and [Locale.countryCode] only
|
||||
/// 1. [Locale.languageCode] and [Locale.countryCode] only
|
||||
/// 1. [Locale.languageCode] only
|
||||
/// 1. [Locale.countryCode] only when all preferred locales fail to match
|
||||
/// 1. Returns the first element of [supportedLocales] as a fallback
|
||||
///
|
||||
/// When more than one supported locale matches one of these criteria, only the first
|
||||
/// matching locale is returned. See [basicLocaleListResolution] for a complete
|
||||
/// description of the algorithm.
|
||||
/// When more than one supported locale matches one of these criteria, only
|
||||
/// the first matching locale is returned.
|
||||
///
|
||||
/// The default locale resolution algorithm can be overridden by providing a value for
|
||||
/// [localeListResolutionCallback]. The provided [basicLocaleListResolution] is optimized
|
||||
/// for speed and does not implement a full algorithm (such as the one defined in
|
||||
/// [Unicode TR35](https://unicode.org/reports/tr35/#LanguageMatching)) that takes
|
||||
/// distances between languages into account.
|
||||
/// The default locale resolution algorithm can be overridden by providing a
|
||||
/// value for [localeListResolutionCallback]. The provided
|
||||
/// `basicLocaleListResolution` is optimized for speed and does not implement
|
||||
/// a full algorithm (such as the one defined in
|
||||
/// [Unicode TR35](https://unicode.org/reports/tr35/#LanguageMatching)) that
|
||||
/// takes distances between languages into account.
|
||||
///
|
||||
/// When supporting languages with more than one script, it is recommended
|
||||
/// to specify the [Locale.scriptCode] explicitly. Locales may also be defined without
|
||||
@ -626,8 +627,6 @@ class WidgetsApp extends StatefulWidget {
|
||||
/// when the device's locale changes.
|
||||
/// * [localizationsDelegates], which collectively define all of the localized
|
||||
/// resources used by this app.
|
||||
/// * [basicLocaleListResolution], a static method that implements the locale resolution
|
||||
/// algorithm that is used when no custom locale resolution algorithm is provided.
|
||||
final Iterable<Locale> supportedLocales;
|
||||
|
||||
/// Turns on a performance overlay.
|
||||
@ -847,40 +846,41 @@ class _WidgetsAppState extends State<WidgetsApp> with WidgetsBindingObserver {
|
||||
|
||||
/// The default locale resolution algorithm.
|
||||
///
|
||||
/// Custom resolution algorithms can be provided through [WidgetsApp.localeListResolutionCallback]
|
||||
/// or [WidgetsApp.localeResolutionCallback].
|
||||
/// Custom resolution algorithms can be provided through
|
||||
/// [WidgetsApp.localeListResolutionCallback] or
|
||||
/// [WidgetsApp.localeResolutionCallback].
|
||||
///
|
||||
/// When no custom locale resolution algorithms are provided or if both fail to resolve,
|
||||
/// Flutter will default to calling this algorithm.
|
||||
/// When no custom locale resolution algorithms are provided or if both fail
|
||||
/// to resolve, Flutter will default to calling this algorithm.
|
||||
///
|
||||
/// This algorithm prioritizes speed at the cost of slightly less appropriate
|
||||
/// resolutions for edge cases.
|
||||
///
|
||||
/// This algorithm will resolve to the earliest locale in [preferredLocales] that
|
||||
/// This algorithm will resolve to the earliest preferred locale that
|
||||
/// matches the most fields, prioritizing in the order of perfect match,
|
||||
/// languageCode+countryCode, languageCode+scriptCode, languageCode-only.
|
||||
///
|
||||
/// In the case where a locale is matched by languageCode-only and is not the
|
||||
/// default (first) locale, the next locale in preferredLocales with a
|
||||
/// default (first) locale, the next preferred locale with a
|
||||
/// perfect match can supersede the languageCode-only match if it exists.
|
||||
///
|
||||
/// When a preferredLocale matches more than one supported locale, it will resolve
|
||||
/// to the first matching locale listed in the supportedLocales.
|
||||
/// When a preferredLocale matches more than one supported locale, it will
|
||||
/// resolve to the first matching locale listed in the supportedLocales.
|
||||
///
|
||||
/// When all [preferredLocales] have been exhausted without a match, the first countryCode only
|
||||
/// match will be returned.
|
||||
/// When all preferred locales have been exhausted without a match, the first
|
||||
/// countryCode only match will be returned.
|
||||
///
|
||||
/// When no match at all is found, the first (default) locale in [supportedLocales] will be
|
||||
/// returned.
|
||||
/// When no match at all is found, the first (default) locale in
|
||||
/// [supportedLocales] will be returned.
|
||||
///
|
||||
/// To summarize, the main matching priority is:
|
||||
///
|
||||
/// 1. [Locale.languageCode], [Locale.scriptCode], and [Locale.countryCode]
|
||||
/// 2. [Locale.languageCode] and [Locale.scriptCode] only
|
||||
/// 3. [Locale.languageCode] and [Locale.countryCode] only
|
||||
/// 4. [Locale.languageCode] only (with caveats, see above)
|
||||
/// 5. [Locale.countryCode] only when all [preferredLocales] fail to match
|
||||
/// 6. returns [supportedLocales.first] as a fallback
|
||||
/// 1. [Locale.languageCode] and [Locale.scriptCode] only
|
||||
/// 1. [Locale.languageCode] and [Locale.countryCode] only
|
||||
/// 1. [Locale.languageCode] only (with caveats, see above)
|
||||
/// 1. [Locale.countryCode] only when all [preferredLocales] fail to match
|
||||
/// 1. Returns the first element of [supportedLocales] as a fallback
|
||||
///
|
||||
/// This algorithm does not take language distance (how similar languages are to each other)
|
||||
/// into account, and will not handle edge cases such as resolving `de` to `fr` rather than `zh`
|
||||
|
@ -6416,12 +6416,12 @@ class Semantics extends SingleChildRenderObjectWidget {
|
||||
/// Whether descendants of this widget are allowed to add semantic information
|
||||
/// to the [SemanticsNode] annotated by this widget.
|
||||
///
|
||||
/// When set to false descendants are allowed to annotate [SemanticNode]s of
|
||||
/// When set to false descendants are allowed to annotate [SemanticsNode]s of
|
||||
/// their parent with the semantic information they want to contribute to the
|
||||
/// semantic tree.
|
||||
/// When set to true the only way for descendants to contribute semantic
|
||||
/// information to the semantic tree is to introduce new explicit
|
||||
/// [SemanticNode]s to the tree.
|
||||
/// [SemanticsNode]s to the tree.
|
||||
///
|
||||
/// If the semantics properties of this node include
|
||||
/// [SemanticsProperties.scopesRoute] set to true, then [explicitChildNodes]
|
||||
|
@ -503,11 +503,11 @@ class EditableText extends StatefulWidget {
|
||||
/// Whether to show cursor.
|
||||
///
|
||||
/// The cursor refers to the blinking caret when the [EditableText] is focused.
|
||||
/// {@endtemplate}
|
||||
///
|
||||
/// See also:
|
||||
///
|
||||
/// * [showSelectionHandles], which controls the visibility of the selection handles.
|
||||
/// {@endtemplate}
|
||||
final bool showCursor;
|
||||
|
||||
/// {@template flutter.widgets.editableText.autocorrect}
|
||||
|
@ -1662,7 +1662,7 @@ mixin WidgetInspectorService {
|
||||
///
|
||||
/// If the currently selected [RenderObject] is identical to the
|
||||
/// [RenderObject] referenced by `previousSelectionId` then the previous
|
||||
/// [DiagnosticNode] is reused.
|
||||
/// [DiagnosticsNode] is reused.
|
||||
@protected
|
||||
String getSelectedRenderObject(String previousSelectionId, String groupName) {
|
||||
return _safeJsonEncode(_getSelectedRenderObject(previousSelectionId, groupName));
|
||||
@ -1677,7 +1677,7 @@ mixin WidgetInspectorService {
|
||||
/// Returns a [DiagnosticsNode] representing the currently selected [Element].
|
||||
///
|
||||
/// If the currently selected [Element] is identical to the [Element]
|
||||
/// referenced by `previousSelectionId` then the previous [DiagnosticNode] is
|
||||
/// referenced by `previousSelectionId` then the previous [DiagnosticsNode] is
|
||||
/// reused.
|
||||
@protected
|
||||
String getSelectedWidget(String previousSelectionId, String groupName) {
|
||||
@ -1767,7 +1767,7 @@ mixin WidgetInspectorService {
|
||||
/// tree.
|
||||
///
|
||||
/// If the currently selected [Element] is identical to the [Element]
|
||||
/// referenced by `previousSelectionId` then the previous [DiagnosticNode] is
|
||||
/// referenced by `previousSelectionId` then the previous [DiagnosticsNode] is
|
||||
/// reused.
|
||||
String getSelectedSummaryWidget(String previousSelectionId, String groupName) {
|
||||
return _safeJsonEncode(_getSelectedSummaryWidget(previousSelectionId, groupName));
|
||||
|
Loading…
x
Reference in New Issue
Block a user