menu

  1. [ Flutter ](index.html)
  2. [ painting.dart ](painting/painting-library.html)
  3. InlineSpan class 

InlineSpan

brightness_4  brightness_5

[ description
](https://github.com/flutter/flutter/blob/master/packages/flutter/lib/src/painting/inline_span.dart#L196
"View source code")

#  InlineSpan  class [ abstract ](https://dart.dev/language/class-
modifiers#abstract "This type can not be directly constructed.")

An immutable span of inline content which forms part of a paragraph.

  * The subclass [ TextSpan ](painting/TextSpan-class.html) specifies text and may contain child [ InlineSpan ](painting/InlineSpan-class.html) s. 
  * The subclass [ PlaceholderSpan ](painting/PlaceholderSpan-class.html) represents a placeholder that may be filled with non-text content. [ PlaceholderSpan ](painting/PlaceholderSpan-class.html) itself defines a [ ui.PlaceholderAlignment ](dart-ui/PlaceholderAlignment.html) and a [ TextBaseline ](dart-ui/TextBaseline.html) . To be useful, [ PlaceholderSpan ](painting/PlaceholderSpan-class.html) must be extended to define content. An instance of this is the [ WidgetSpan ](widgets/WidgetSpan-class.html) class in the widgets library. 
  * The subclass [ WidgetSpan ](widgets/WidgetSpan-class.html) specifies embedded inline widgets. 

This example shows a tree of [ InlineSpan ](painting/InlineSpan-class.html) s
that make a query asking for a name with a [ TextField ](material/TextField-
class.html) embedded inline.

_link_

_content_copy_

    
    
    Text.rich(
      TextSpan(
        text: 'My name is ',
        style: const TextStyle(color: Colors.black),
        children: <InlineSpan>[
          WidgetSpan(
            alignment: PlaceholderAlignment.baseline,
            baseline: TextBaseline.alphabetic,
            child: ConstrainedBox(
              constraints: const BoxConstraints(maxWidth: 100),
              child: const TextField(),
            )
          ),
          const TextSpan(
            text: '.',
          ),
        ],
      ),
    )

See also:

  * [ Text ](widgets/Text-class.html) , a widget for showing uniformly-styled text. 
  * [ RichText ](widgets/RichText-class.html) , a widget for finer control of text rendering. 
  * [ TextPainter ](painting/TextPainter-class.html) , a class for painting [ InlineSpan ](painting/InlineSpan-class.html) objects on a [ Canvas ](dart-ui/Canvas-class.html) . 

Inheritance

    

  * [ Object ](dart-core/Object-class.html)
  * [ DiagnosticableTree ](foundation/DiagnosticableTree-class.html)
  * InlineSpan 

Implementers

    

  * [ PlaceholderSpan ](painting/PlaceholderSpan-class.html)
  * [ TextSpan ](painting/TextSpan-class.html)

Annotations

    

  * @ [ immutable ](meta/immutable-constant.html)

##  Constructors

[ InlineSpan ](painting/InlineSpan/InlineSpan.html) (  {  [ TextStyle
](painting/TextStyle-class.html) ?  style  }  )

     Creates an [ InlineSpan ](painting/InlineSpan-class.html) with the given values. 

const

##  Properties

[ hashCode ](painting/InlineSpan/hashCode.html) → [ int ](dart-core/int-
class.html)

     The hash code for this object. 

no setter  override

[ runtimeType ](dart-core/Object/runtimeType.html) → [ Type ](dart-core/Type-
class.html)

     A representation of the runtime type of the object. 

no setter  inherited

[ style ](painting/InlineSpan/style.html) → [ TextStyle ](painting/TextStyle-
class.html) ?

     The [ TextStyle ](painting/TextStyle-class.html) to apply to this span. 

final

##  Methods

[ build ](painting/InlineSpan/build.html) (  [ ParagraphBuilder ](dart-
ui/ParagraphBuilder-class.html) builder  ,  {  [ TextScaler
](painting/TextScaler-class.html) textScaler  =  TextScaler.noScaling  ,  [
List ](dart-core/List-class.html) < [ PlaceholderDimensions
](painting/PlaceholderDimensions-class.html) > ?  dimensions  }  )  → void

     Apply the properties of this object to the given [ ParagraphBuilder ](dart-ui/ParagraphBuilder-class.html) , from which a [ Paragraph ](dart-ui/Parag