Beagle v1.6 não é mais mantida ativamente. A versão documentada que você está visualizando pode conter funcionalidades depreciadas. Para obter as funcionalidades mais recentes, consulte a nossa última versão .
Margin aplica um espaçamento no elemento filho, e tem os seguintes atributos: all, bottom, end, horizontal, left, right, start, top, vertical
Define um espaçamento em todos os lados do elemento:
private fun screen() :Widget{
return Container(
children = listOf(
createText(backgroundColor = "#142850", text = "1").applyFlex(
flex = Flex(margin = EdgeValue(all = 10.unitReal()))
),
createText(backgroundColor = "#dd7631", text = "2"),
createText(backgroundColor = "#649d66", text = "3")
)
).applyFlex(
Flex(
grow = 1.0,
justifyContent = JustifyContent.FLEX_START,
flexDirection = FlexDirection.ROW
)
)
}
private func screen() -> Screen {
return
Screen(
navigationBar: NavigationBar(title: "Flex"),
child:
Container(children: [
createText(backgroundColor: "#142850",text: "1").applyFlex(
Flex().margin(EdgeValue().all(10))),
createText(backgroundColor: "#dd7631",text: "2"),
createText(backgroundColor: "#649d66",text: "3"),
],widgetProperties: WidgetProperties(
flex: Flex()
.flexDirection(.row)
.justifyContent(.flexStart)
.grow(1)
)
)
)
}
Define um espaçamento na parte inferior do elemento:
private fun screen() :Widget{
return Container(
children = listOf(
createText(backgroundColor = "#142850", text = "1").applyFlex(
flex = Flex(margin = EdgeValue(bottom = 10.unitReal()))
),
createText(backgroundColor = "#dd7631", text = "2"),
createText(backgroundColor = "#649d66", text = "3")
)
).applyFlex(
Flex(
grow = 1.0,
justifyContent = JustifyContent.FLEX_START,
flexDirection = FlexDirection.COLUMN
)
)
}
private func screen() -> Screen {
return
Screen(
navigationBar: NavigationBar(title: "Flex"),
child:
Container(children: [
createText(backgroundColor: "#142850",text: "1").applyFlex(
Flex()
.size(Size().height(50).width(50))
.margin(EdgeValue().bottom(10))),
createText(backgroundColor: "#dd7631",text: "2"),
createText(backgroundColor: "#649d66",text: "3"),
],widgetProperties: WidgetProperties(
flex: Flex()
.flexDirection(.column)
.justifyContent(.flexStart)
.grow(1)
)
)
)
}
Define um espaçamento no lado esquerdo do elemento:
private fun screen() :Widget{
return Container(
children = listOf(
createText(backgroundColor = "#142850", text = "1").applyFlex(
flex = Flex(margin = EdgeValue(left = 10.unitReal()))
),
createText(backgroundColor = "#dd7631", text = "2"),
createText(backgroundColor = "#649d66", text = "3")
)
).applyFlex(
Flex(
grow = 1.0,
justifyContent = JustifyContent.FLEX_START,
flexDirection = FlexDirection.ROW
)
)
}
private func screen() -> Screen {
return
Screen(
navigationBar: NavigationBar(title: "Flex"),
child:
Container(children: [
createText(backgroundColor: "#142850",text: "1").applyFlex(
Flex()
.size(Size().height(50).width(50))
.margin(EdgeValue().left(10))),
createText(backgroundColor: "#dd7631",text: "2"),
createText(backgroundColor: "#649d66",text: "3"),
],widgetProperties: WidgetProperties(
flex: Flex()
.flexDirection(.row)
.justifyContent(.flexStart)
.grow(1)
)
)
)
}
Define um espaçamento no lado direito do elemento:
private fun screen() :Widget{
return Container(
children = listOf(
createText(backgroundColor = "#142850", text = "1").applyFlex(
flex = Flex(margin = EdgeValue(right = 10.unitReal()))
),
createText(backgroundColor = "#dd7631", text = "2"),
createText(backgroundColor = "#649d66", text = "3")
)
).applyFlex(
Flex(
grow = 1.0,
justifyContent = JustifyContent.FLEX_START,
flexDirection = FlexDirection.ROW
)
)
}
private func screen() -> Screen {
return
Screen(
navigationBar: NavigationBar(title: "Flex"),
child:
Container(children: [
createText(backgroundColor: "#142850",text: "1").applyFlex(
Flex()
.size(Size().height(50).width(50))
.margin(EdgeValue().right(10))),
createText(backgroundColor: "#dd7631",text: "2"),
createText(backgroundColor: "#649d66",text: "3"),
],widgetProperties: WidgetProperties(
flex: Flex()
.flexDirection(.row)
.justifyContent(.flexStart)
.grow(1)
)
)
)
}
Define um espaçamento na parte superior do elemento:
private fun screen() :Widget{
return Container(
children = listOf(
createText(backgroundColor = "#142850", text = "1").applyFlex(
flex = Flex(margin = EdgeValue(top = 10.unitReal()))
),
createText(backgroundColor = "#dd7631", text = "2"),
createText(backgroundColor = "#649d66", text = "3")
)
).applyFlex(
Flex(
grow = 1.0,
justifyContent = JustifyContent.FLEX_START,
flexDirection = FlexDirection.ROW
)
)
}
private func screen() -> Screen {
return
Screen(
navigationBar: NavigationBar(title: "Flex"),
child:
Container(children: [
createText(backgroundColor: "#142850",text: "1").applyFlex(
Flex()
.size(Size().height(50).width(50))
.margin(EdgeValue().top(10))),
createText(backgroundColor: "#dd7631",text: "2"),
createText(backgroundColor: "#649d66",text: "3"),
],widgetProperties: WidgetProperties(
flex: Flex()
.flexDirection(.row)
.justifyContent(.flexStart)
.grow(1)
)
)
)
}
Define um espaçamento no eixo horizontal do elemento:
private fun screen() :Widget{
return Container(
children = listOf(
createText(backgroundColor = "#142850", text = "1").applyFlex(
flex = Flex(margin = EdgeValue(horizontal = 10.unitReal()))
),
createText(backgroundColor = "#dd7631", text = "2"),
createText(backgroundColor = "#649d66", text = "3")
)
).applyFlex(
Flex(
grow = 1.0,
justifyContent = JustifyContent.FLEX_START,
flexDirection = FlexDirection.ROW
)
)
}
private func screen() -> Screen {
return
Screen(
navigationBar: NavigationBar(title: "Flex"),
child:
Container(children: [
createText(backgroundColor: "#142850",text: "1").applyFlex(
Flex()
.size(Size().height(50).width(50))
.margin(EdgeValue().horizontal(10))),
createText(backgroundColor: "#dd7631",text: "2"),
createText(backgroundColor: "#649d66",text: "3"),
],widgetProperties: WidgetProperties(
flex: Flex()
.flexDirection(.row)
.justifyContent(.flexStart)
.grow(1)
)
)
)
}
Define um espaçamento no eixo vertical do elemento:
private fun screen() :Widget{
return Container(
children = listOf(
createText(backgroundColor = "#142850", text = "1").applyFlex(
flex = Flex(margin = EdgeValue(vertical = 10.unitReal()))
),
createText(backgroundColor = "#dd7631", text = "2"),
createText(backgroundColor = "#649d66", text = "3")
)
).applyFlex(
Flex(
grow = 1.0,
justifyContent = JustifyContent.FLEX_START,
flexDirection = FlexDirection.ROW
)
)
}
private func screen() -> Screen {
return
Screen(
navigationBar: NavigationBar(title: "Flex"),
child:
Container(children: [
createText(backgroundColor: "#142850",text: "1").applyFlex(
Flex()
.size(Size().height(50).width(50))
.margin(EdgeValue().vertical(10))),
createText(backgroundColor: "#dd7631",text: "2"),
createText(backgroundColor: "#649d66",text: "3"),
],widgetProperties: WidgetProperties(
flex: Flex()
.flexDirection(.column)
.justifyContent(.flexStart)
.grow(1)
)
)
)
}
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.