RText class

RichText 魔改版 建议使用 BText.rich,动态配置字体颜色

Inheritance
Available extensions

Constructors

RText({Key? key, required List<String> texts, TextStyle? style, List<TextStyle?> styles = const [], List<GestureRecognizer?> recognizers = const [], List<String?> semanticsLabels = const [], List<MouseCursor?> mouseCursors = const [], List<PointerEnterEventListener?> onEnters = const [], List<PointerExitEventListener?> onExits = const [], List<Locale?> locales = const [], List<bool?> spellOuts = const [], StrutStyle? strutStyle, TextAlign textAlign = TextAlign.center, TextDirection? textDirection, Locale? locale, bool softWrap = true, TextOverflow overflow = TextOverflow.clip, double textScaleFactor = 1.0, int? maxLines, TextWidthBasis textWidthBasis = TextWidthBasis.parent, TextHeightBehavior? textHeightBehavior, SelectionRegistrar? selectionRegistrar, Color? selectionColor})

Properties

children List<Widget>
The widgets below this widget in the tree.
finalinherited
expand SizedBox

Available on Widget, provided by the ExtensionWidget extension

no setter
expandedNull Expanded

Available on Widget, provided by the ExtensionWidget extension

no setter
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
locale Locale?
Used to select a font when the same Unicode character can be rendered differently, depending on the locale.
finalinherited
maxLines int?
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.
finalinherited
overflow TextOverflow
How visual overflow should be handled.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selectionColor Color?
The color to use when painting the selection.
finalinherited
selectionRegistrar SelectionRegistrar?
The SelectionRegistrar this rich text is subscribed to.
finalinherited
shrink SizedBox

Available on Widget, provided by the ExtensionWidget extension

no setter
softWrap bool
Whether the text should break at soft line breaks.
finalinherited
strutStyle StrutStyle?
The strut style to use. Strut style defines the strut, which sets minimum vertical layout metrics.
finalinherited
text InlineSpan
The text to display in this widget.
finalinherited
textAlign TextAlign
How the text should be aligned horizontally.
finalinherited
textDirection TextDirection?
The directionality of the text.
finalinherited
textHeightBehavior TextHeightBehavior?
Defines how to apply TextStyle.height over and under text.
finalinherited
textScaleFactor double
Deprecated. Will be removed in a future version of Flutter. Use textScaler instead.
no setterinherited
textScaler TextScaler
The font scaling strategy to use when laying out and rendering the text.
finalinherited
textWidthBasis TextWidthBasis
Defines how to measure the width of the rendered text.
finalinherited
toRoutePageBuilder RoutePageBuilder

Available on Widget, provided by the ExtensionWidget extension

no setter
toRouteTransitionsBuilder RouteTransitionsBuilder

Available on Widget, provided by the ExtensionWidget extension

no setter
toSliverBox Widget

Available on Widget, provided by the ExtensionWidget extension

no setter
toWidgetBuilder WidgetBuilder

Available on Widget, provided by the ExtensionWidget extension

no setter

Methods

align({Key? key, Alignment alignment = Alignment.center, double? widthFactor, double? heightFactor}) Align

Available on Widget, provided by the ExtensionWidget extension

animatedAlign(Duration duration, {Key? key, Alignment alignment = Alignment.center, Curve curve = Curves.linear, VoidCallback? onEnd}) AnimatedAlign

Available on Widget, provided by the ExtensionWidget extension

animatedContainer(Duration duration, {Key? key, Alignment? alignment, EdgeInsetsGeometry? padding, Color? color, Decoration? decoration, Decoration? foregroundDecoration, double? width, double? height, BoxConstraints? constraints, EdgeInsetsGeometry? margin, Matrix4? transform, Curve curve = Curves.linear, VoidCallback? onEnd}) AnimatedContainer

Available on Widget, provided by the ExtensionWidget extension

animatedPadding({Key? key, Curve curve = Curves.linear, required Duration duration, required EdgeInsetsGeometry padding, VoidCallback? onEnd}) AnimatedPadding

Available on Widget, provided by the ExtensionWidget extension

asList() List<Widget>

Available on Widget, provided by the ExtensionWidget extension

backdropFilter({Key? key, ImageFilter? filter, double fuzzyDegree = 4}) BackdropFilter

Available on Widget, provided by the ExtensionWidget extension

buildPageRoute<T>({bool maintainState = true, bool fullscreenDialog = false, String? title, required RoutePushStyle pushStyle, RouteSettings? settings}) PageRoute<T>

Available on Widget, provided by the ExtensionWidget extension

card({Color? color, Color? shadowColor, double? elevation, ShapeBorder? shape, bool? borderOnForeground, EdgeInsetsGeometry? margin, Clip? clipBehavior, bool? semanticContainer}) Card

Available on Widget, provided by the ExtensionWidget extension

center({Key? key, double? widthFactor, double? heightFactor}) Center

Available on Widget, provided by the ExtensionWidget extension

clipOval({Key? key, BorderRadius borderRadius = BorderRadius.zero, CustomClipper<Rect>? clipper, Clip clipBehavior = Clip.antiAlias}) ClipOval

Available on Widget, provided by the ExtensionWidget extension

clipPath({Key? key, BorderRadius borderRadius = BorderRadius.zero, CustomClipper<Path>? clipper, Clip clipBehavior = Clip.antiAlias}) ClipPath

Available on Widget, provided by the ExtensionWidget extension

clipRRect({Key? key, BorderRadius borderRadius = BorderRadius.zero, CustomClipper<RRect>? clipper, Clip clipBehavior = Clip.antiAlias}) ClipRRect

Available on Widget, provided by the ExtensionWidget extension

color(Color color, {Key? key}) ColoredBox

Available on Widget, provided by the ExtensionWidget extension

constrainedBox(BoxConstraints constraints, {Key? key}) ConstrainedBox

Available on Widget, provided by the ExtensionWidget extension

container({Key? key, EdgeInsetsGeometry? padding, Decoration? foregroundDecoration, Matrix4? transform, BoxConstraints? constraints, Color? color, double? width, double? height, EdgeInsetsGeometry? margin, Decoration? decoration, Clip? clipBehavior, AlignmentGeometry? alignment}) Container

Available on Widget, provided by the ExtensionWidget extension

createElement() MultiChildRenderObjectElement
RenderObjectWidgets always inflate to a RenderObjectElement subclass.
inherited
createRenderObject(BuildContext context) RenderParagraph
Creates an instance of the RenderObject class that this RenderObjectWidget represents, using the configuration described by this RenderObjectWidget.
inherited
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
decoratedBox(Decoration decoration, {Key? key, DecorationPosition position = DecorationPosition.background}) DecoratedBox

Available on Widget, provided by the ExtensionWidget extension

didUnmountRenderObject(covariant RenderObject renderObject) → void
This method is called when a RenderObject that was previously associated with this widget is removed from the render tree. The provided RenderObject will be of the same type as the one created by this widget's createRenderObject method.
inherited
expanded({Key? key, int flex = 1}) Expanded

Available on Widget, provided by the ExtensionWidget extension

fittedBox({Key? key, BoxFit fit = BoxFit.contain, AlignmentGeometry alignment = Alignment.center, Clip clipBehavior = Clip.none}) FittedBox

Available on Widget, provided by the ExtensionWidget extension

flexible({Key? key, int flex = 1, FlexFit fit = FlexFit.loose}) Flexible

Available on Widget, provided by the ExtensionWidget extension

fromSize(Size size, {Key? key}) SizedBox

Available on Widget, provided by the ExtensionWidget extension

gestureDetector({Key? key, GestureTapDownCallback? onTapDown, GestureTapUpCallback? onTapUp, GestureTapCallback? onTap, GestureTapCancelCallback? onTapCancel, GestureTapDownCallback? onSecondaryTapDown, GestureTapUpCallback? onSecondaryTapUp, GestureTapCancelCallback? onSecondaryTapCancel, GestureTapCallback? onDoubleTap, GestureLongPressCallback? onLongPress, GestureLongPressStartCallback? onLongPressStart, GestureLongPressMoveUpdateCallback? onLongPressMoveUpdate, GestureLongPressUpCallback? onLongPressUp, GestureLongPressEndCallback? onLongPressEnd, GestureDragDownCallback? onVerticalDragDown, GestureDragStartCallback? onVerticalDragStart, GestureDragUpdateCallback? onVerticalDragUpdate, GestureDragEndCallback? onVerticalDragEnd, GestureDragCancelCallback? onVerticalDragCancel, GestureDragDownCallback? onHorizontalDragDown, GestureDragStartCallback? onHorizontalDragStart, GestureDragUpdateCallback? onHorizontalDragUpdate, GestureDragEndCallback? onHorizontalDragEnd, GestureDragCancelCallback? onHorizontalDragCancel, GestureForcePressStartCallback? onForcePressStart, GestureForcePressPeakCallback? onForcePressPeak, GestureForcePressUpdateCallback? onForcePressUpdate, GestureForcePressEndCallback? onForcePressEnd, GestureDragDownCallback? onPanDown, GestureDragStartCallback? onPanStart, GestureDragUpdateCallback? onPanUpdate, GestureDragEndCallback? onPanEnd, GestureDragCancelCallback? onPanCancel, GestureScaleStartCallback? onScaleStart, GestureScaleUpdateCallback? onScaleUpdate, GestureScaleEndCallback? onScaleEnd, HitTestBehavior? behavior, bool excludeFromSemantics = false, DragStartBehavior dragStartBehavior = DragStartBehavior.start}) GestureDetector

Available on Widget, provided by the ExtensionWidget extension

hero(Object tag, {Key? key, CreateRectTween? createRectTween, HeroFlightShuttleBuilder? flightShuttleBuilder, HeroPlaceholderBuilder? placeholderBuilder, bool transitionOnUserGestures = false}) Hero

Available on Widget, provided by the ExtensionWidget extension

intoConstrainedBox(BoxConstraints constraints, {Key? key}) ConstrainedBox

Available on Widget, provided by the ExtensionWidget extension

limitedBox({Key? key, double maxWidth = double.infinity, double maxHeight = double.infinity}) LimitedBox

Available on Widget, provided by the ExtensionWidget extension

margin(EdgeInsetsGeometry margin, {Key? key}) Padding

Available on Widget, provided by the ExtensionWidget extension

marginAll(double margin) Widget

Available on Widget, provided by the ExtensionWidget extension

marginOnly({double left = 0.0, double top = 0.0, double right = 0.0, double bottom = 0.0}) Widget

Available on Widget, provided by the ExtensionWidget extension

marginSymmetric({double horizontal = 0.0, double vertical = 0.0}) Widget

Available on Widget, provided by the ExtensionWidget extension

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
offstage(bool offstage, {Key? key}) Offstage

Available on Widget, provided by the ExtensionWidget extension

onDoubleTap(GestureTapCallback onDoubleTap, {Key? key}) GestureDetector

Available on Widget, provided by the ExtensionWidget extension

onLongPress(GestureLongPressCallback onLongPress, {Key? key}) GestureDetector

Available on Widget, provided by the ExtensionWidget extension

onTap(GestureTapCallback? onTap, {Key? key}) GestureDetector

Available on Widget, provided by the ExtensionWidget extension

overflowBox({Key? key, Alignment alignment = Alignment.center, double? minWidth, double? maxWidth, double? minHeight, double? maxHeight}) OverflowBox

Available on Widget, provided by the ExtensionWidget extension

padding(EdgeInsetsGeometry padding) Padding

Available on Widget, provided by the ExtensionWidget extension

paddingAll(double padding) Widget

Available on Widget, provided by the ExtensionWidget extension

paddingOnly({double left = 0.0, double top = 0.0, double right = 0.0, double bottom = 0.0}) Widget

Available on Widget, provided by the ExtensionWidget extension

paddingSymmetric({double horizontal = 0.0, double vertical = 0.0}) Widget

Available on Widget, provided by the ExtensionWidget extension

popupBottomSheet<T>({WidgetBuilder? builder, BottomSheetOptions? options}) Future<T?>

Available on Widget, provided by the ExtensionWidgetMethod extension

showModalBottomSheet 关闭 closePopup()
popupCupertinoDialog<T>({WidgetBuilder? builder, DialogOptions? options}) Future<T?>

Available on Widget, provided by the ExtensionWidgetMethod extension

Cupertino 风格的 Dialog showCupertinoDialog
popupCupertinoModal<T>({WidgetBuilder? builder, CupertinoModalPopupOptions? options}) Future<T?>

Available on Widget, provided by the ExtensionWidgetMethod extension

showCupertinoModalPopup 全屏显示
popupDialog<T>({RoutePageBuilder? builder, DialogOptions? options}) Future<T?>

Available on Widget, provided by the ExtensionWidgetMethod extension

showGeneralDialog
popupMaterialDialog<T>({WidgetBuilder? builder, DialogOptions? options}) Future<T?>

Available on Widget, provided by the ExtensionWidgetMethod extension

Material 风格的 Dialog showDialog
positioned({Key? key, double? left, double? top, double? right, double? bottom, double? width, double? height}) Positioned

Available on Widget, provided by the ExtensionWidget extension

push<T extends Object?, TO extends Object?>({bool maintainState = true, bool fullscreenDialog = false, RoutePushStyle pushStyle = RoutePushStyle.material, RouteSettings? settings, bool replacement = false, TO? result}) Future<T?>

Available on Widget, provided by the ExtensionWidgetMethod extension

push or pushReplacement
pushAndRemoveUntil<T extends Object?>({bool maintainState = true, bool fullscreenDialog = false, RoutePushStyle pushStyle = RoutePushStyle.material, RouteSettings? settings, RoutePredicate? predicate}) Future<T?>

Available on Widget, provided by the ExtensionWidgetMethod extension

pushAndRemoveUntil
pushReplacement<T extends Object?, TO extends Object?>({bool maintainState = true, bool fullscreenDialog = false, RoutePushStyle pushStyle = RoutePushStyle.material, RouteSettings? settings, TO? result}) Future<T?>

Available on Widget, provided by the ExtensionWidgetMethod extension

pushReplacement
rotatedBox(int quarterTurns, {Key? key}) RotatedBox

Available on Widget, provided by the ExtensionWidget extension

setHeight(double height, {Key? key}) SizedBox

Available on Widget, provided by the ExtensionWidget extension

setSize(Size size, {Key? key}) SizedBox

Available on Widget, provided by the ExtensionWidget extension

setWidth(double width, {Key? key}) SizedBox

Available on Widget, provided by the ExtensionWidget extension

showLoading({ModalWindowsOptions? options}) ExtendedOverlayEntry?

Available on Widget, provided by the ExtensionWidgetMethod extension

ExtendedOverlay().showLoading(this)
showOverlay({bool autoOff = false}) ExtendedOverlayEntry?

Available on Widget, provided by the ExtensionWidgetMethod extension

ExtendedOverlay().showOverlay()
singleChildScrollView({Key? key, Axis scrollDirection = Axis.vertical, bool reverse = false, EdgeInsetsGeometry? padding, bool? primary, ScrollPhysics? physics, ScrollController? controller, DragStartBehavior dragStartBehavior = DragStartBehavior.start}) SingleChildScrollView

Available on Widget, provided by the ExtensionWidget extension

sizedBox({Key? key, double? width, double? height}) SizedBox

Available on Widget, provided by the ExtensionWidget extension

sizedOverflowBox(Size size, {Key? key, Alignment alignment = Alignment.center}) SizedOverflowBox

Available on Widget, provided by the ExtensionWidget extension

sliverToBoxAdapter({Key? key}) SliverToBoxAdapter

Available on Widget, provided by the ExtensionWidget extension

statusBarStyle(SystemUiOverlayStyle style) AnnotatedRegion<SystemUiOverlayStyle>

Available on Widget, provided by the ExtensionWidget extension

toDecoratorEntry({DecoratorPositioned positioned = DecoratorPositioned.outer, OverlayVisibilityMode mode = OverlayVisibilityMode.always}) DecoratorEntry

Available on Widget, provided by the ExtensionWidget extension

toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited
transform({Key? key, required Matrix4 transform, Offset? origin, AlignmentGeometry? alignment, bool? transformHitTests}) Transform

Available on Widget, provided by the ExtensionWidget extension

unconstrainedBox({Key? key, TextDirection? textDirection, Alignment alignment = Alignment.center, Axis? constrainedAxis}) UnconstrainedBox

Available on Widget, provided by the ExtensionWidget extension

updateRenderObject(BuildContext context, covariant RenderParagraph renderObject) → void
Copies the configuration described by this RenderObjectWidget to the given RenderObject, which will be of the same type as returned by this object's createRenderObject.
inherited
visibility(bool visible, {Key? key}) Visibility

Available on Widget, provided by the ExtensionWidget extension

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

buildTextSpan(List<TextSpan> textSpans) TextSpan
buildTextSpans({TextStyle? style, required List<String> texts, required List<TextStyle?> styles, required List<GestureRecognizer?> recognizers, required List<String?> semanticsLabels, required List<MouseCursor?> mouseCursors, required List<PointerEnterEventListener?> onEnters, required List<PointerExitEventListener?> onExits, required List<Locale?> locales, required List<bool?> spellOuts}) List<TextSpan>
convertTextStyle(BuildContext context, TextStyle style) → dynamic