文档
Container
SafeArea
属性 | 类型 | 关联类 / 常量 | 备注 |
uniqueId | String | | 唯一 id |
unitName | String | | 组件名称 "SafeArea" |
child | Object | | 子节点对象 |
children | Object | | 子节点列表 |
align | Object | FLDyUnitAlign | 布局描述 |
left | bool | | SafeArea.left |
top | bool | | SafeArea.top |
right | bool | | SafeArea.right |
bottom | bool | | SafeArea.bottom |
minimum | Object | FLDyUnitEdgeInsets | SafeArea.minimum |
maintainBottomViewPadding | bool | | SafeArea.maintainBottomViewPadding |
Stack
属性 | 类型 | 关联类 / 常量 | 备注 |
uniqueId | String | | 唯一 id |
unitName | String | | 组件名称 "Stack" |
positioned | Object | FLDyUnitPositioned | 绝对定位位置描述 |
children | Object | | 子节点列表 |
alignment | String | Alignment | Stack.alignment |
textDirection | String | TextDirection | Stack.textDirection |
fit | String | StackFit | Stack.fit |
overflow | String | Overflow | Stack.overflow |
ListView
属性 | 类型 | 关联类 / 常量 | 备注 |
uniqueId | String | | 唯一 id |
unitName | String | | 组件名称 "ListView" |
positioned | Object | FLDyUnitPositioned | 绝对定位位置描述 |
children | Object | | 子节点列表 |
scrollDirection | String | Axis | ListView.scrollDirection |
reverse | bool | | ListView.reverse |
primary | bool | | ListView.primary |
scrollPhysics | Object | FLDyUnitScrollPhysics | ListView.scrollPhysics |
shrinkWrap | bool | | ListView.shrinkWrap |
padding | Object | FLDyUnitEdgeInsets | ListView.padding |
itemExtent | double | | ListView.itemExtent |
addAutomaticKeepAlives | bool | | ListView.addAutomaticKeepAlives |
addRepaintBoundaries | bool | | ListView.addRepaintBoundaries |
addSemanticIndexes | double | | ListView.addSemanticIndexes |
cacheExtent | double | | ListView.cacheExtent |
semanticChildCount | int | | ListView.semanticChildCount |
separatedDivider | Object | FLDyUnitDivider | 分割线对象 |
ListTile
属性 | 类型 | 关联类 / 常量 | 备注 |
uniqueId | String | | 唯一 id |
unitName | String | | 组件名称 "ListTile" |
positioned | Object | FLDyUnitPositioned | 绝对定位位置描述 |
leading | Object | | ListTile.leading |
title | Object | | ListTile.title |
subtitle | Object | | ListTile.subtitle |
trailing | Object | | ListTile.trailing |
isThreeLine | bool | | ListTile.isThreeLine |
dense | bool | | ListTile.dense |
contentPadding | Object | FLDyUnitEdgeInsets | ListTile.contentPadding |
enabled | bool | | ListTile.enabled |
selected | bool | | ListTile.selected |
InkWell
属性 | 类型 | 关联类 / 常量 | 备注 |
uniqueId | String | | 唯一 id |
unitName | String | | 组件名称 "InkWell" |
child | Object | | 子节点对象 |
children | Object | | 子节点列表 |
flex | String | | flex 属性 |
positioned | Object | FLDyUnitPositioned | 绝对定位位置描述 |
align | Object | FLDyUnitAlign | 布局描述 |
onTap | Object | FLDyAction | 点击事件 |
onDoubleTap | Object | FLDyAction | 双击事件 |
onLongPress | Object | FLDyAction | 长按事件 |
focusColor | String | | InkWell.focusColor |
hoverColor | String | | InkWell.hoverColor |
highlightColor | String | | InkWell.highlightColor |
splashColor | String | | InkWell.splashColor |
SizedBox
属性 | 类型 | 关联类 / 常量 | 备注 |
uniqueId | String | | 唯一 id |
unitName | String | | 组件名称 "SizedBox" |
width | double | | SizedBox.width |
height | double | | SizedBox.height |
Text
属性 | 类型 | 关联类 / 常量 | 备注 |
uniqueId | String | | 唯一 id |
unitName | String | | 组件名称 "Text" |
positioned | Object | FLDyUnitPositioned | 绝对定位位置描述 |
text | String | | Text.data |
textStyle | Object | FLDyUnitTextStyle | Text.textStyle |
textAlign | String | TextAlign | Text.textAlign |
textDirection | String | TextDirection | Text.textDirection |
softWrap | bool | | Text.softWrap |
textOverflow | String | TextOverflow | Text.textOverflow |
textScaleFactor | double | | Text.textScaleFactor |
maxLines | int | | Text.maxLines |
semanticsLabel | String | | Text.semanticsLabel |
textWidthBasis | String | TextWidthBasis | Text.textWidthBasis |
RichText
属性 | 类型 | 关联类 / 常量 | 备注 |
uniqueId | String | | 唯一 id |
unitName | String | | 组件名称 "RichText" |
positioned | Object | FLDyUnitPositioned | 绝对定位位置描述 |
text | Object | TextSpan | 内联文本 |
textAlign | String | TextAlign | RichText.textAlign |
textDirection | String | TextDirection | RichText.textDirection |
softWrap | bool | | RichText.softWrap |
textOverflow | String | TextOverflow | RichText.textOverflow |
textScaleFactor | double | | RichText.textScaleFactor |
maxLines | int | | RichText.maxLines |
semanticsLabel | String | | RichText.semanticsLabel |
textWidthBasis | String | TextWidthBasis | RichText.textWidthBasis |
TextSpan
属性 | 类型 | 关联类 / 常量 | 备注 |
uniqueId | String | | 唯一 id |
children | Object | | 子节点列表 |
text | String | | TextSpan.text |
textStyle | Object | FLDyUnitTextStyle | TextSpan.textStyle |
gesture | String | FLDyGestureRecognizer | TextSpan.gesture |
semanticsLabel | String | | TextSpan.semanticsLabel |
Image
属性 | 类型 | 关联类 / 常量 | 备注 |
uniqueId | String | | 唯一 id |
unitName | String | | 组件名称 "Image" |
flex | String | | flex 属性 |
positioned | Object | FLDyUnitPositioned | 绝对定位位置描述 |
imageProvider | Object | ImageProvider | Image.imageProvider |
loading | Object | | Image.loadingBuilder |
width | double | | Image.width |
height | double | | Image.height |
color | String | | Image.color |
fit | String | BoxFit | Image.fit |
alignment | String | Alignment | Image.alignment |
imageRepeat | String | ImageRepeat | Image.imageRepeat |
semanticLabel | String | | Image.semanticLabel |
excludeFromSemantics | bool | | Image.excludeFromSemantics |
Icon
属性 | 类型 | 关联类 / 常量 | 备注 |
uniqueId | String | | 唯一 id |
unitName | String | | 组件名称 "Icon" |
positioned | Object | FLDyUnitPositioned | 绝对定位位置描述 |
icon | Object | FLDyUnitIconData | Icon.iconData |
size | double | | Icon.size |
color | String | | Icon.size |
semanticLabel | String | | Icon.size |
textDirection | String | TextDirection | Icon.size |
属性 | 类型 | 关联类 / 常量 | 备注 |
uniqueId | String | | 唯一 id |
unitName | String | | 组件名称 "RaisedButton" |
child | Object | | 子节点对象 |
children | Object | | 子节点列表 |
flex | String | | flex 属性 |
positioned | Object | FLDyUnitPositioned | 绝对定位位置描述 |
align | Object | FLDyUnitAlign | 布局描述 |
onPressed | Object | FLDyAction | 点击事件 |
onLongPress | Object | FLDyAction | 长按事件 |
textColor | String | | RaisedButton.textColor |
color | String | | RaisedButton.color |
padding | Object | FLDyUnitEdgeInsets | RaisedButton.padding |
属性 | 类型 | 关联类 / 常量 | 备注 |
uniqueId | String | | 唯一 id |
unitName | String | | 组件名称 "Container" |
child | Object | | 子节点对象 |
children | Object | | 子节点列表 |
flex | String | | flex 属性 |
positioned | Object | FLDyUnitPositioned | 绝对定位位置描述 |
align | Object | FLDyUnitAlign | 布局描述 |
onPressed | Object | FLDyAction | 点击事件 |
onLongPress | Object | FLDyAction | 长按事件 |
textColor | String | | FlatButton.textColor |
color | String | | FlatButton.color |
padding | Object | FLDyUnitEdgeInsets | FlatButton.padding |
样式类
FLDyUnitIconData
IconData
属性 | 类型 | 备注 |
codePoint | int | |
fontFamily | String | |
fontPackage | String | |
matchTextDirection | bool | |
FLDyUnitTextStyle
TextStyle
属性 | 类型 | 备注 |
themeStyle | String | |
inherit | bool | |
color | String | |
backgroundColor | String | |
fontFamily | String | |
fontSize | double | |
fontWeight | String | FontWeight |
fontStyle | String | FontStyle |
letterSpacing | double | |
wordSpacing | double | |
textBaseline | String | TextBaseline |
height | double | |
textDecorations | List<String> | TextDecoration |
decorationColor | String | |
decorationStyle | String | TextDecorationStyle |
decorationThickness | double | |
FLDyUnitDivider
Divider
属性 | 类型 | 备注 |
height | double | |
thickness | double | |
indent | double | |
endIndent | double | |
color | String | |
ScrollPhysics
FLDyUnitEdgeInsets
EdgeInsets
属性 | 类型 | 备注 |
top | double | |
left | double | |
bottom | double | |
right | double | |
all | double | EdgeInsets.all() |
FLDyUnitImageProvider
ImageProvider
属性 | 类型 | 备注 |
type | String | "assets" , "network" |
url | String | |
assetName | String | |
scale | double | |
FLDyUnitDecorationImage
DecorationImage
FLDyUnitBoxConstraints
BoxConstraints
属性 | 类型 | 备注 |
minWidth | double | |
maxWidth | double | |
minHeight | double | |
maxHeight | double | |
FLDyUnitBoxDecoration
BoxDecoration
FLDyUnitBoxShadow
BoxShadow
属性 | 类型 | 备注 |
color | String | |
offset | FLDyUnitOffset | |
blurRadius | double | |
spreadRadius | double | |
FLDyUnitOffset
Offset
属性 | 类型 | 备注 |
dx | double | |
dy | double | |
FLDyUnitBorderRadius
BorderRadius
属性 | 类型 | 备注 |
radius | double | BorderRadius.circular(radius) |
FLDyUnitBorder
Border
属性 | 类型 | 备注 |
color | String | |
width | double | |
style | String | BorderStyle |
Row, Column, Center
FLDyUnitPositioned
Positioned
属性 | 类型 | 备注 |
left | double | |
top | double | |
right | double | |
bottom | double | |
width | double | |
height | double | |
常量
MainAxisSize
MainAxisAlignment
start
end
center
spaceBetween
spaceAround
spaceEvenly
CrossAxisAlignment
start
end
center
stretch
baseline
BoxFit
fill
contain
cover
contain
fitWidth
contain
fitHeight
none
scaleDown
Alignment
topLeft
topCenter
topRight
centerLeft
center
centerRight
bottomLeft
bottomCenter
bottomRight
ImageRepeat
repeat
repeatX
repeatY
noRepeat
BorderStyle
BoxShape
Axis
Bouncing
Clamping
AlwaysScrollable
NeverScrollable
FontWeight
FontStyle
TextBaseline
TextDecoration
none
underline
overline
lineThrough
TextDecorationStyle
solid
double
dotted
dashed
wavy
TextAlign
left
right
center
justify
start
end
TextDirection
TextOverflow
clip
fade
ellipsis
visible
TextWidthBasis
StackFit
Overflow
AlignmentDirectional
topStart
topCenter
topEnd
centerStart
center
centerEnd
bottomStart
bottomCenter
bottomEnd
行为
FLDyAction
属性 | 类型 | 备注 |
actionType | String | "builtin" , "custom" |
action | String | 行为描述,可以是内置模式也可以是自定义行为 |
args | List<String> | 参数列表 |
FLDyGestureRecognizer
FLDyActionDispatch
FLDyActionDispatch 是一个单例,提供自定义行为的注册派发等功能。
方法列表:
dispatcher
: 获取单例 registerActionHandler
: 注册行为回调 removeActionHandler
: 删除回调
内置模式
navigator
@navigator.pushNamed
: 调用 Navigator.pushNamed 方法,FLDyAction.args 的第一个参数将作为 name 传递给该方法 @navigator.pop
: 调用 Navigator.pop 方法
flui
@flui.textToast
: 调用 FLToast.text 方法, FLDyAction.args 的第一个参数将作为 text 传递给该方法 @flui.successToast
: 调用 FLToast.success 方法, FLDyAction.args 的第一个参数将作为 text 传递给该方法 @flui.errorToast
: 调用 FLToast.error 方法, FLDyAction.args 的第一个参数将作为 text 传递给该方法 @flui.infoToast
: 调用 FLToast.info 方法, FLDyAction.args 的第一个参数将作为 text 传递给该方法
theme
在使用 Color 字符串时,可以通过 @theme
来读取当前主题颜色。
@theme.primaryColor
@theme.primaryColorLight
@theme.primaryColorDark
@theme.accentColor
@theme.canvasColor
@theme.scaffoldBackgroundColor
@theme.bottomAppBarColor
@theme.cardColor
@theme.dividerColor
@theme.focusColor
@theme.hoverColor
@theme.highlightColor
@theme.splashColor
@theme.selectedRowColor
@theme.unselectedWidgetColor
@theme.disabledColor
@theme.buttonColor
@theme.secondaryHeaderColor
@theme.textSelectionColor
@theme.textSelectionHandleColor
@theme.backgroundColor
@theme.dialogBackgroundColor
@theme.indicatorColor
@theme.hintColor
@theme.errorColor
@theme.toggleableActiveColor
textTheme
FLDyUnitTextStyle 类型可以使用 @textTheme
来读取文字主题风格。
@textTheme.display4
@textTheme.display3
@textTheme.display2
@textTheme.display1
@textTheme.headline
@textTheme.title
@textTheme.subhead
@textTheme.body2
@textTheme.body1
@textTheme.caption
@textTheme.button
@textTheme.subtitle
@textTheme.overline