text.dart 21.9 KB
Newer Older
Ian Hickson's avatar
Ian Hickson committed
1
// Copyright 2014 The Flutter Authors. All rights reserved.
2 3 4
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

5 6
import 'dart:ui' as ui show TextHeightBehavior;

7
import 'package:flutter/foundation.dart';
8
import 'package:flutter/painting.dart';
9 10 11

import 'basic.dart';
import 'framework.dart';
12
import 'inherited_theme.dart';
13 14
import 'media_query.dart';

15 16 17
// Examples can assume:
// String _name;

18 19
/// The text style to apply to descendant [Text] widgets which don't have an
/// explicit style.
20 21 22 23 24 25 26
///
/// See also:
///
///  * [AnimatedDefaultTextStyle], which animates changes in the text style
///    smoothly over a given duration.
///  * [DefaultTextStyleTransition], which takes a provided [Animation] to
///    animate changes in text style smoothly over time.
27
class DefaultTextStyle extends InheritedTheme {
28 29
  /// Creates a default text style for the given subtree.
  ///
30
  /// Consider using [DefaultTextStyle.merge] to inherit styling information
31
  /// from the current default text style for a given [BuildContext].
32 33 34 35 36 37 38 39
  ///
  /// The [style] and [child] arguments are required and must not be null.
  ///
  /// The [softWrap] and [overflow] arguments must not be null (though they do
  /// have default values).
  ///
  /// The [maxLines] property may be null (and indeed defaults to null), but if
  /// it is not null, it must be greater than zero.
40
  const DefaultTextStyle({
41 42
    Key? key,
    required this.style,
43
    this.textAlign,
44 45
    this.softWrap = true,
    this.overflow = TextOverflow.clip,
46
    this.maxLines,
47
    this.textWidthBasis = TextWidthBasis.parent,
48
    this.textHeightBehavior,
49
    required Widget child,
50 51 52
  }) : assert(style != null),
       assert(softWrap != null),
       assert(overflow != null),
53
       assert(maxLines == null || maxLines > 0),
54
       assert(child != null),
55
       assert(textWidthBasis != null),
56
       super(key: key, child: child);
57

58
  /// A const-constructable default text style that provides fallback values.
59 60
  ///
  /// Returned from [of] when the given [BuildContext] doesn't have an enclosing default text style.
61
  ///
62
  /// This constructor creates a [DefaultTextStyle] with an invalid [child], which
63
  /// means the constructed value cannot be incorporated into the tree.
64
  const DefaultTextStyle.fallback({ Key? key })
65 66 67
    : style = const TextStyle(),
      textAlign = null,
      softWrap = true,
68
      maxLines = null,
69
      overflow = TextOverflow.clip,
70
      textWidthBasis = TextWidthBasis.parent,
71
      textHeightBehavior = null,
72
      super(key: key, child: const _NullWidget());
73

74 75
  /// Creates a default text style that overrides the text styles in scope at
  /// this point in the widget tree.
76 77
  ///
  /// The given [style] is merged with the [style] from the default text style
78 79 80
  /// for the [BuildContext] where the widget is inserted, and any of the other
  /// arguments that are not null replace the corresponding properties on that
  /// same default text style.
81 82 83 84 85 86 87 88 89
  ///
  /// This constructor cannot be used to override the [maxLines] property of the
  /// ancestor with the value null, since null here is used to mean "defer to
  /// ancestor". To replace a non-null [maxLines] from an ancestor with the null
  /// value (to remove the restriction on number of lines), manually obtain the
  /// ambient [DefaultTextStyle] using [DefaultTextStyle.of], then create a new
  /// [DefaultTextStyle] using the [new DefaultTextStyle] constructor directly.
  /// See the source below for an example of how to do this (since that's
  /// essentially what this constructor does).
90
  static Widget merge({
91 92 93 94 95 96 97 98
    Key? key,
    TextStyle? style,
    TextAlign? textAlign,
    bool? softWrap,
    TextOverflow? overflow,
    int? maxLines,
    TextWidthBasis? textWidthBasis,
    required Widget child,
99 100
  }) {
    assert(child != null);
101
    return Builder(
102 103
      builder: (BuildContext context) {
        final DefaultTextStyle parent = DefaultTextStyle.of(context);
104
        return DefaultTextStyle(
105
          key: key,
106
          style: parent.style!.merge(style),
107 108 109 110
          textAlign: textAlign ?? parent.textAlign,
          softWrap: softWrap ?? parent.softWrap,
          overflow: overflow ?? parent.overflow,
          maxLines: maxLines ?? parent.maxLines,
111
          textWidthBasis: textWidthBasis ?? parent.textWidthBasis,
112
          child: child,
113 114
        );
      },
115 116 117 118
    );
  }

  /// The text style to apply.
119
  final TextStyle? style;
120

121
  /// How each line of text in the Text widget should be aligned horizontally.
122
  final TextAlign? textAlign;
123 124 125 126

  /// Whether the text should break at soft line breaks.
  ///
  /// If false, the glyphs in the text will be positioned as if there was unlimited horizontal space.
127 128 129
  ///
  /// This also decides the [overflow] property's behavior. If this is true or null,
  /// the glyph causing overflow, and those that follow, will not be rendered.
130 131 132
  final bool softWrap;

  /// How visual overflow should be handled.
133 134 135
  ///
  /// If [softWrap] is true or null, the glyph causing overflow, and those that follow,
  /// will not be rendered. Otherwise, it will be shown with the given overflow option.
136 137
  final TextOverflow overflow;

138 139 140
  /// An optional maximum number of lines for the text to span, wrapping if necessary.
  /// If the text exceeds the given number of lines, it will be truncated according
  /// to [overflow].
141 142 143 144 145 146
  ///
  /// If this is 1, text will not wrap. Otherwise, text will be wrapped at the
  /// edge of the box.
  ///
  /// If this is non-null, it will override even explicit null values of
  /// [Text.maxLines].
147
  final int? maxLines;
148

149
  /// The strategy to use when calculating the width of the Text.
150
  ///
151 152 153
  /// See [TextWidthBasis] for possible values and their implications.
  final TextWidthBasis textWidthBasis;

154
  /// {@macro flutter.dart:ui.textHeightBehavior}
155
  final ui.TextHeightBehavior? textHeightBehavior;
156

157 158 159 160
  /// The closest instance of this class that encloses the given context.
  ///
  /// If no such instance exists, returns an instance created by
  /// [DefaultTextStyle.fallback], which contains fallback values.
161 162 163 164 165 166
  ///
  /// Typical usage is as follows:
  ///
  /// ```dart
  /// DefaultTextStyle style = DefaultTextStyle.of(context);
  /// ```
167
  static DefaultTextStyle of(BuildContext context) {
168
    return context.dependOnInheritedWidgetOfExactType<DefaultTextStyle>() ?? const DefaultTextStyle.fallback();
169 170 171
  }

  @override
172 173 174 175 176
  bool updateShouldNotify(DefaultTextStyle oldWidget) {
    return style != oldWidget.style ||
        textAlign != oldWidget.textAlign ||
        softWrap != oldWidget.softWrap ||
        overflow != oldWidget.overflow ||
177
        maxLines != oldWidget.maxLines ||
178 179
        textWidthBasis != oldWidget.textWidthBasis ||
        textHeightBehavior != oldWidget.textHeightBehavior;
180 181 182 183
  }

  @override
  Widget wrap(BuildContext context, Widget child) {
184
    final DefaultTextStyle? defaultTextStyle = context.findAncestorWidgetOfExactType<DefaultTextStyle>();
185 186 187 188 189 190 191
    return identical(this, defaultTextStyle) ? child : DefaultTextStyle(
      style: style,
      textAlign: textAlign,
      softWrap: softWrap,
      overflow: overflow,
      maxLines: maxLines,
      textWidthBasis: textWidthBasis,
192
      textHeightBehavior: textHeightBehavior,
193 194
      child: child,
    );
195
  }
196 197

  @override
198 199 200
  void debugFillProperties(DiagnosticPropertiesBuilder properties) {
    super.debugFillProperties(properties);
    style?.debugFillProperties(properties);
201 202 203 204
    properties.add(EnumProperty<TextAlign>('textAlign', textAlign, defaultValue: null));
    properties.add(FlagProperty('softWrap', value: softWrap, ifTrue: 'wrapping at box width', ifFalse: 'no wrapping except at line break characters', showName: true));
    properties.add(EnumProperty<TextOverflow>('overflow', overflow, defaultValue: null));
    properties.add(IntProperty('maxLines', maxLines, defaultValue: null));
205
    properties.add(EnumProperty<TextWidthBasis>('textWidthBasis', textWidthBasis, defaultValue: TextWidthBasis.parent));
206
    properties.add(DiagnosticsProperty<ui.TextHeightBehavior>('textHeightBehavior', textHeightBehavior, defaultValue: null));
207 208 209
  }
}

210 211 212 213 214 215 216 217 218 219 220 221 222
class _NullWidget extends StatelessWidget {
  const _NullWidget();

  @override
  Widget build(BuildContext context) {
    throw FlutterError(
      'A DefaultTextStyle constructed with DefaultTextStyle.fallback cannot be incorporated into the widget tree, '
      'it is meant only to provide a fallback value returned by DefaultTextStyle.of() '
      'when no enclosing default text style is present in a BuildContext.'
    );
  }
}

223 224
/// The [TextHeightBehavior] that will apply to descendant [Text] and [EditableText]
/// widgets which have not explicitly set [Text.textHeightBehavior].
225 226 227 228 229 230 231 232 233 234 235 236 237 238
///
/// If there is a [DefaultTextStyle] with a non-null [DefaultTextStyle.textHeightBehavior]
/// below this widget, the [DefaultTextStyle.textHeightBehavior] will be used
/// over this widget's [TextHeightBehavior].
///
/// See also:
///
///  * [DefaultTextStyle], which defines a [TextStyle] to apply to descendant
///    [Text] widgets.
class DefaultTextHeightBehavior extends InheritedTheme {
  /// Creates a default text height behavior for the given subtree.
  ///
  /// The [textHeightBehavior] and [child] arguments are required and must not be null.
  const DefaultTextHeightBehavior({
239 240 241
    Key? key,
    required this.textHeightBehavior,
    required Widget child,
242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257
  }) :  assert(textHeightBehavior != null),
        assert(child != null),
        super(key: key, child: child);

  /// {@macro flutter.dart:ui.textHeightBehavior}
  final TextHeightBehavior textHeightBehavior;

  /// The closest instance of this class that encloses the given context.
  ///
  /// If no such instance exists, this method will return `null`.
  ///
  /// Typical usage is as follows:
  ///
  /// ```dart
  /// DefaultTextHeightBehavior defaultTextHeightBehavior = DefaultTextHeightBehavior.of(context);
  /// ```
258
  static TextHeightBehavior? of(BuildContext context) {
259 260 261 262 263 264 265 266 267 268
    return context.dependOnInheritedWidgetOfExactType<DefaultTextHeightBehavior>()?.textHeightBehavior;
  }

  @override
  bool updateShouldNotify(DefaultTextHeightBehavior oldWidget) {
    return textHeightBehavior != oldWidget.textHeightBehavior;
  }

  @override
  Widget wrap(BuildContext context, Widget child) {
269
    final DefaultTextHeightBehavior? defaultTextHeightBehavior = context.findAncestorWidgetOfExactType<DefaultTextHeightBehavior>();
270 271 272 273 274 275 276 277 278 279 280 281 282
    return identical(this, defaultTextHeightBehavior) ? child : DefaultTextHeightBehavior(
      textHeightBehavior: textHeightBehavior,
      child: child,
    );
  }

  @override
  void debugFillProperties(DiagnosticPropertiesBuilder properties) {
    super.debugFillProperties(properties);
    properties.add(DiagnosticsProperty<ui.TextHeightBehavior>('textHeightBehavior', textHeightBehavior, defaultValue: null));
  }
}

283 284 285 286 287 288 289 290
/// A run of text with a single style.
///
/// The [Text] widget displays a string of text with single style. The string
/// might break across multiple lines or might all be displayed on the same line
/// depending on the layout constraints.
///
/// The [style] argument is optional. When omitted, the text will use the style
/// from the closest enclosing [DefaultTextStyle]. If the given style's
291 292 293 294
/// [TextStyle.inherit] property is true (the default), the given style will
/// be merged with the closest enclosing [DefaultTextStyle]. This merging
/// behavior is useful, for example, to make the text bold while using the
/// default font family and size.
295
///
296
/// {@tool snippet}
297
///
298 299
/// This example shows how to display text using the [Text] widget with the
/// [overflow] set to [TextOverflow.ellipsis].
300
///
301
/// ![If the text is shorter than the available space, it is displayed in full without an ellipsis.](https://flutter.github.io/assets-for-api-docs/assets/widgets/text.png)
302
///
303
/// ![If the text overflows, the Text widget displays an ellipsis to trim the overflowing text](https://flutter.github.io/assets-for-api-docs/assets/widgets/text_ellipsis.png)
304
///
305
/// ```dart
306
/// Text(
307
///   'Hello, $_name! How are you?',
308 309
///   textAlign: TextAlign.center,
///   overflow: TextOverflow.ellipsis,
310
///   style: TextStyle(fontWeight: FontWeight.bold),
311 312
/// )
/// ```
313
/// {@end-tool}
314
///
315 316 317 318 319
/// Using the [Text.rich] constructor, the [Text] widget can
/// display a paragraph with differently styled [TextSpan]s. The sample
/// that follows displays "Hello beautiful world" with different styles
/// for each word.
///
320
/// {@tool snippet}
321
///
322
/// ![The word "Hello" is shown with the default text styles. The word "beautiful" is italicized. The word "world" is bold.](https://flutter.github.io/assets-for-api-docs/assets/widgets/text_rich.png)
323
///
324 325
/// ```dart
/// const Text.rich(
326
///   TextSpan(
327
///     text: 'Hello', // default text style
328 329 330
///     children: <TextSpan>[
///       TextSpan(text: ' beautiful ', style: TextStyle(fontStyle: FontStyle.italic)),
///       TextSpan(text: 'world', style: TextStyle(fontWeight: FontWeight.bold)),
331 332
///     ],
///   ),
333
/// )
334
/// ```
335
/// {@end-tool}
336
///
337 338 339 340 341
/// ## Interactivity
///
/// To make [Text] react to touch events, wrap it in a [GestureDetector] widget
/// with a [GestureDetector.onTap] handler.
///
342
/// In a material design application, consider using a [TextButton] instead, or
343 344 345 346 347 348 349
/// if that isn't appropriate, at least using an [InkWell] instead of
/// [GestureDetector].
///
/// To make sections of the text interactive, use [RichText] and specify a
/// [TapGestureRecognizer] as the [TextSpan.recognizer] of the relevant part of
/// the text.
///
350 351
/// See also:
///
352 353
///  * [RichText], which gives you more control over the text styles.
///  * [DefaultTextStyle], which sets default styles for [Text] widgets.
354 355 356 357 358
class Text extends StatelessWidget {
  /// Creates a text widget.
  ///
  /// If the [style] argument is null, the text will use the style from the
  /// closest enclosing [DefaultTextStyle].
359 360
  ///
  /// The [data] parameter must not be null.
361 362 363 364
  ///
  /// The [overflow] property's behavior is affected by the [softWrap] argument.
  /// If the [softWrap] is true or null, the glyph causing overflow, and those that follow,
  /// will not be rendered. Otherwise, it will be shown with the given overflow option.
365
  const Text(
366 367
    String this.data, {
    Key? key,
368
    this.style,
369
    this.strutStyle,
370
    this.textAlign,
Ian Hickson's avatar
Ian Hickson committed
371
    this.textDirection,
372
    this.locale,
373 374
    this.softWrap,
    this.overflow,
375 376
    this.textScaleFactor,
    this.maxLines,
377
    this.semanticsLabel,
378
    this.textWidthBasis,
379
    this.textHeightBehavior,
380 381 382 383
  }) : assert(
         data != null,
         'A non-null String must be provided to a Text widget.',
       ),
384
       textSpan = null,
385
       super(key: key);
386

387 388 389 390 391 392
  /// Creates a text widget with a [InlineSpan].
  ///
  /// The following subclasses of [InlineSpan] may be used to build rich text:
  ///
  /// * [TextSpan]s define text and children [InlineSpan]s.
  /// * [WidgetSpan]s define embedded inline widgets.
393 394
  ///
  /// The [textSpan] parameter must not be null.
395 396
  ///
  /// See [RichText] which provides a lower-level way to draw text.
397
  const Text.rich(
398 399
    InlineSpan this.textSpan, {
    Key? key,
400
    this.style,
401
    this.strutStyle,
402 403
    this.textAlign,
    this.textDirection,
404
    this.locale,
405 406 407 408
    this.softWrap,
    this.overflow,
    this.textScaleFactor,
    this.maxLines,
409
    this.semanticsLabel,
410
    this.textWidthBasis,
411
    this.textHeightBehavior,
412 413 414 415
  }) : assert(
         textSpan != null,
         'A non-null TextSpan must be provided to a Text.rich widget.',
       ),
416 417
       data = null,
       super(key: key);
418

419
  /// The text to display.
420 421
  ///
  /// This will be null if a [textSpan] is provided instead.
422
  final String? data;
423

424
  /// The text to display as a [InlineSpan].
425 426
  ///
  /// This will be null if [data] is provided instead.
427
  final InlineSpan? textSpan;
428

429 430 431 432 433
  /// If non-null, the style to use for this text.
  ///
  /// If the style's "inherit" property is true, the style will be merged with
  /// the closest enclosing [DefaultTextStyle]. Otherwise, the style will
  /// replace the closest enclosing [DefaultTextStyle].
434
  final TextStyle? style;
435

436
  /// {@macro flutter.painting.textPainter.strutStyle}
437
  final StrutStyle? strutStyle;
438

439
  /// How the text should be aligned horizontally.
440
  final TextAlign? textAlign;
441

Ian Hickson's avatar
Ian Hickson committed
442 443 444 445 446 447 448 449 450
  /// The directionality of the text.
  ///
  /// This decides how [textAlign] values like [TextAlign.start] and
  /// [TextAlign.end] are interpreted.
  ///
  /// This is also used to disambiguate how to render bidirectional text. For
  /// example, if the [data] is an English phrase followed by a Hebrew phrase,
  /// in a [TextDirection.ltr] context the English phrase will be on the left
  /// and the Hebrew phrase to its right, while in a [TextDirection.rtl]
451
  /// context, the English phrase will be on the right and the Hebrew phrase on
Ian Hickson's avatar
Ian Hickson committed
452 453 454
  /// its left.
  ///
  /// Defaults to the ambient [Directionality], if any.
455
  final TextDirection? textDirection;
Ian Hickson's avatar
Ian Hickson committed
456

457 458 459 460 461 462 463
  /// Used to select a font when the same Unicode character can
  /// be rendered differently, depending on the locale.
  ///
  /// It's rarely necessary to set this property. By default its value
  /// is inherited from the enclosing app with `Localizations.localeOf(context)`.
  ///
  /// See [RenderParagraph.locale] for more information.
464
  final Locale? locale;
465

466 467 468
  /// Whether the text should break at soft line breaks.
  ///
  /// If false, the glyphs in the text will be positioned as if there was unlimited horizontal space.
469
  final bool? softWrap;
470 471

  /// How visual overflow should be handled.
472 473
  ///
  /// Defaults to retrieving the value from the nearest [DefaultTextStyle] ancestor.
474
  final TextOverflow? overflow;
475 476 477 478 479 480

  /// The number of font pixels for each logical pixel.
  ///
  /// For example, if the text scale factor is 1.5, text will be 50% larger than
  /// the specified font size.
  ///
481
  /// The value given to the constructor as textScaleFactor. If null, will
482
  /// use the [MediaQueryData.textScaleFactor] obtained from the ambient
483
  /// [MediaQuery], or 1.0 if there is no [MediaQuery] in scope.
484
  final double? textScaleFactor;
485

486
  /// An optional maximum number of lines for the text to span, wrapping if necessary.
487 488
  /// If the text exceeds the given number of lines, it will be truncated according
  /// to [overflow].
489 490 491 492 493 494 495 496
  ///
  /// If this is 1, text will not wrap. Otherwise, text will be wrapped at the
  /// edge of the box.
  ///
  /// If this is null, but there is an ambient [DefaultTextStyle] that specifies
  /// an explicit number for its [DefaultTextStyle.maxLines], then the
  /// [DefaultTextStyle] value will take precedence. You can use a [RichText]
  /// widget directly to entirely override the [DefaultTextStyle].
497
  final int? maxLines;
498

499 500 501
  /// An alternative semantics label for this text.
  ///
  /// If present, the semantics of this widget will contain this value instead
502 503
  /// of the actual text. This will overwrite any of the semantics labels applied
  /// directly to the [TextSpan]s.
504
  ///
505
  /// This is useful for replacing abbreviations or shorthands with the full
506 507 508
  /// text value:
  ///
  /// ```dart
509
  /// Text(r'$$', semanticsLabel: 'Double dollars')
510
  /// ```
511
  final String? semanticsLabel;
512

513
  /// {@macro flutter.painting.textPainter.textWidthBasis}
514
  final TextWidthBasis? textWidthBasis;
515

516
  /// {@macro flutter.dart:ui.textHeightBehavior}
517
  final ui.TextHeightBehavior? textHeightBehavior;
518

519 520
  @override
  Widget build(BuildContext context) {
521
    final DefaultTextStyle defaultTextStyle = DefaultTextStyle.of(context);
522 523 524
    TextStyle? effectiveTextStyle = style;
    if (style == null || style!.inherit)
      effectiveTextStyle = defaultTextStyle.style!.merge(style);
525
    if (MediaQuery.boldTextOverride(context))
526
      effectiveTextStyle = effectiveTextStyle!.merge(const TextStyle(fontWeight: FontWeight.bold));
527
    Widget result = RichText(
Ian Hickson's avatar
Ian Hickson committed
528 529
      textAlign: textAlign ?? defaultTextStyle.textAlign ?? TextAlign.start,
      textDirection: textDirection, // RichText uses Directionality.of to obtain a default if this is null.
530
      locale: locale, // RichText uses Localizations.localeOf to obtain a default if this is null
531 532
      softWrap: softWrap ?? defaultTextStyle.softWrap,
      overflow: overflow ?? defaultTextStyle.overflow,
533
      textScaleFactor: textScaleFactor ?? MediaQuery.textScaleFactorOf(context),
534
      maxLines: maxLines ?? defaultTextStyle.maxLines,
535
      strutStyle: strutStyle,
536
      textWidthBasis: textWidthBasis ?? defaultTextStyle.textWidthBasis,
537
      textHeightBehavior: textHeightBehavior ?? defaultTextStyle.textHeightBehavior ?? DefaultTextHeightBehavior.of(context),
538
      text: TextSpan(
539
        style: effectiveTextStyle,
540
        text: data,
541
        children: textSpan != null ? <InlineSpan>[textSpan!] : null,
542
      ),
543
    );
544
    if (semanticsLabel != null) {
545
      result = Semantics(
546 547
        textDirection: textDirection,
        label: semanticsLabel,
548
        child: ExcludeSemantics(
549
          child: result,
550
        ),
551 552 553
      );
    }
    return result;
554 555 556
  }

  @override
557 558
  void debugFillProperties(DiagnosticPropertiesBuilder properties) {
    super.debugFillProperties(properties);
559
    properties.add(StringProperty('data', data, showName: false));
560
    if (textSpan != null) {
561
      properties.add(textSpan!.toDiagnosticsNode(name: 'textSpan', style: DiagnosticsTreeStyle.transition));
562
    }
563
    style?.debugFillProperties(properties);
564 565 566 567 568 569 570
    properties.add(EnumProperty<TextAlign>('textAlign', textAlign, defaultValue: null));
    properties.add(EnumProperty<TextDirection>('textDirection', textDirection, defaultValue: null));
    properties.add(DiagnosticsProperty<Locale>('locale', locale, defaultValue: null));
    properties.add(FlagProperty('softWrap', value: softWrap, ifTrue: 'wrapping at box width', ifFalse: 'no wrapping except at line break characters', showName: true));
    properties.add(EnumProperty<TextOverflow>('overflow', overflow, defaultValue: null));
    properties.add(DoubleProperty('textScaleFactor', textScaleFactor, defaultValue: null));
    properties.add(IntProperty('maxLines', maxLines, defaultValue: null));
571 572
    properties.add(EnumProperty<TextWidthBasis>('textWidthBasis', textWidthBasis, defaultValue: null));
    properties.add(DiagnosticsProperty<ui.TextHeightBehavior>('textHeightBehavior', textHeightBehavior, defaultValue: null));
573
    if (semanticsLabel != null) {
574
      properties.add(StringProperty('semanticsLabel', semanticsLabel));
575
    }
576 577
  }
}