GridItemWidget class
包装Widget并携带grid item信息的容器
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- GridItemWidget
- Available extensions
Constructors
Properties
- child → Widget
-
final
- colEnd → int?
-
final
- colSpan → int?
-
final
- colStart → int?
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- rowEnd → int?
-
final
- rowSpan → int?
-
final
- rowStart → int?
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
asAlign(
{AlignmentGeometry alignment = Alignment.center, double? widthFactor, double? heightFactor}) → Align -
Available on Widget, provided by the WidgetConversionExt extension
转换为 Align,对齐布局 -
asCard(
{Color? color, double? elevation, ShapeBorder? shape, bool borderOnForeground = true, EdgeInsetsGeometry? margin, Clip? clipBehavior}) → Card -
Available on Widget, provided by the WidgetConversionExt extension
转换为 Card,卡片布局 -
asCenter(
{double? widthFactor, double? heightFactor}) → Center -
Available on Widget, provided by the WidgetConversionExt extension
转换为 Center,居中布局 -
asClipRRect(
{BorderRadius? borderRadius, Clip clipBehavior = Clip.antiAlias}) → ClipRRect -
Available on Widget, provided by the WidgetConversionExt extension
转换为 ClipRRect,圆角裁剪 -
asColumn(
{MainAxisAlignment mainAxisAlignment = MainAxisAlignment.start, CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.center, MainAxisSize mainAxisSize = MainAxisSize.min, TextDirection? textDirection, VerticalDirection verticalDirection = VerticalDirection.down, TextBaseline? textBaseline}) → Column -
Available on Widget, provided by the WidgetConversionExt extension
将单个Widget转换为Column(包装在列表中) -
asContainer(
) → ContainerBuilder -
Available on Widget, provided by the WidgetToContainerBuilder extension
将 Widget 转换为 ContainerBuilder,开始样式链式调用 (新的建造者模式) -
asContainerBuilder(
) → ContainerBuilder -
Available on Widget, provided by the WidgetToContainerBuilder extension
@deprecated 使用新的建造者模式 asContainer() 替代 将 Widget 转换为 ContainerBuilder,开始样式链式调用 -
asElevatedButton(
{required VoidCallback? onPressed, required Widget child}) → Widget -
Available on Widget, provided by the ButtonExtensions extension
将Widget转换为ElevatedButton样式(实际使用GestureDetector) -
asExpanded(
{int flex = 1}) → Expanded -
Available on Widget, provided by the WidgetConversionExt extension
转换为 Expanded,Flex 扩展 -
asFlexible(
{int flex = 1, FlexFit fit = FlexFit.loose}) → Flexible -
Available on Widget, provided by the WidgetConversionExt extension
转换为 Flexible,Flex 弹性 -
asGestureDetector(
{GestureTapCallback? onTap, GestureTapCallback? onDoubleTap, GestureLongPressCallback? onLongPress, void onPanUpdate(DragUpdateDetails)?, HitTestBehavior? behavior}) → GestureDetector -
Available on Widget, provided by the WidgetConversionExt extension
转换为 GestureDetector,手势检测 -
asHero(
{required Object tag, CreateRectTween? createRectTween, HeroFlightShuttleBuilder? flightShuttleBuilder, HeroPlaceholderBuilder? placeholderBuilder, bool transitionOnUserGestures = false}) → Hero -
Available on Widget, provided by the WidgetConversionExt extension
转换为 Hero,英雄动画 -
asInkWell(
{GestureTapCallback? onTap, GestureTapCallback? onDoubleTap, GestureLongPressCallback? onLongPress, Color? splashColor, Color? highlightColor, BorderRadius? borderRadius}) → InkWell -
Available on Widget, provided by the WidgetConversionExt extension
转换为 InkWell,墨水井效果 -
asLegacyContainer(
{AlignmentGeometry? alignment, EdgeInsetsGeometry? padding, Color? color, Decoration? decoration, Decoration? foregroundDecoration, double? width, double? height, BoxConstraints? constraints, EdgeInsetsGeometry? margin, Matrix4? transform, AlignmentGeometry? transformAlignment, Clip clipBehavior = Clip.none}) → Container -
Available on Widget, provided by the WidgetConversionExt extension
转换为 Container,最基础的容器转换 @deprecated 使用新的建造者模式 asContainer() 替代 旧版本的 asContainer 方法,已弃用 -
asOutlinedButton(
{required VoidCallback? onPressed, required Widget child}) → Widget -
Available on Widget, provided by the ButtonExtensions extension
将Widget转换为OutlinedButton样式(实际使用GestureDetector) -
asPadding(
EdgeInsetsGeometry padding) → Padding -
Available on Widget, provided by the WidgetConversionExt extension
转换为 Padding,内边距 -
asPositioned(
{double? left, double? top, double? right, double? bottom, double? width, double? height}) → Positioned -
Available on Widget, provided by the WidgetConversionExt extension
转换为 Positioned,Stack 定位 -
asRow(
{MainAxisAlignment mainAxisAlignment = MainAxisAlignment.start, CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.center, MainAxisSize mainAxisSize = MainAxisSize.min, TextDirection? textDirection, VerticalDirection verticalDirection = VerticalDirection.down, TextBaseline? textBaseline}) → Row -
Available on Widget, provided by the WidgetConversionExt extension
将单个Widget转换为Row(包装在列表中) -
asScrollable(
{Axis scrollDirection = Axis.vertical, EdgeInsetsGeometry? padding}) → SingleChildScrollView -
Available on Widget, provided by the WidgetConversionExt extension
转换为 ScrollView,更简洁的调用 -
asScrollView(
) → ScrollBuilder -
Available on Widget, provided by the WidgetToScrollBuilder extension
将 Widget 转换为 ScrollBuilder,开始 overflow 样式链式调用 -
asScrollView(
{Axis scrollDirection = Axis.vertical, bool reverse = false, EdgeInsetsGeometry? padding, bool? primary, ScrollPhysics? physics, ScrollController? controller}) → SingleChildScrollView -
Available on Widget, provided by the WidgetConversionExt extension
转换为 SingleChildScrollView,支持滚动 -
asSizedBox(
{double? width, double? height}) → SizedBox -
Available on Widget, provided by the WidgetConversionExt extension
转换为 SizedBox,固定尺寸盒子 -
asTextButton(
{required VoidCallback? onPressed, required Widget child}) → Widget -
Available on Widget, provided by the ButtonExtensions extension
将Widget转换为TextButton样式(实际使用GestureDetector) -
bg(
Color color) → Container -
Available on Widget, provided by the WidgetConversionExt extension
设置背景色 - 简化调用 -
boxDecoration(
{Color? color, DecorationImage? image, Border? border, BorderRadius? borderRadius, List< BoxShadow> ? boxShadow, Gradient? gradient, BlendMode? backgroundBlendMode, BoxShape shape = BoxShape.rectangle}) → Container -
Available on Widget, provided by the WidgetConversionExt extension
设置复杂的 BoxDecoration,支持链式调用 -
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
colEnd(
int end) → GridItemWidget -
Available on Widget, provided by the WidgetGridExtension extension
设置grid列结束位置 -
colSpan(
int span) → GridItemWidget -
Available on Widget, provided by the WidgetGridExtension extension
设置grid列跨度 -
colStart(
int start) → GridItemWidget -
Available on Widget, provided by the WidgetGridExtension extension
设置grid列开始位置 -
conditionalBorderRadius(
{bool topLeft = false, bool topRight = false, bool bottomLeft = false, bool bottomRight = false, double radius = 12.0}) → Container -
Available on Widget, provided by the WidgetConversionExt extension
条件圆角 - 可控制每个角 -
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
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
-
gridArea(
{int? colStart, int? colEnd, int? rowStart, int? rowEnd, int? colSpan, int? rowSpan}) → GridItemWidget -
Available on Widget, provided by the WidgetGridExtension extension
设置grid区域 -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onTap(
VoidCallback? onTap) → Widget -
Available on Widget, provided by the ButtonExtensions extension
将Widget转换为可点击的按钮(使用GestureDetector) -
order(
int order) → OrderedWidget -
Available on Widget, provided by the WidgetOrderExtension extension
设置组件的order值(用于Flex布局排序) -
rowEnd(
int end) → GridItemWidget -
Available on Widget, provided by the WidgetGridExtension extension
设置grid行结束位置 -
rowSpan(
int span) → GridItemWidget -
Available on Widget, provided by the WidgetGridExtension extension
设置grid行跨度 -
rowStart(
int start) → GridItemWidget -
Available on Widget, provided by the WidgetGridExtension extension
设置grid行开始位置 -
smartBorderRadius(
{required bool isFirst, required bool isLast, double radius = 12.0, Axis direction = Axis.vertical}) → Container -
Available on Widget, provided by the WidgetConversionExt 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
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited