Closed softmarshmallow closed 1 year ago
This branch is running in CodeSandbox. Use the links below to review this PR faster.
Open in CodeSandbox Web Editor | VS Code | VS Code Insiders | Preview
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
code | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Jun 19, 2023 2:19am |
Background Support
background (fills)
Background handling is quite straightforward, but there are some edge cases that we need to consider.
Considerations
A. Multiple Backgrounds
While CSS supports having multiple background in a single widget, Flutter doesn't.
B. Mixed Types
C. Background Image
transform
Neither CSS nor Flutter supports applying
transform
to a background image. We have to transform the widget tree to properly render it, wrapping the ImageWidget with .D. Video Background Image
Using Image as a background in a single widget is not supported in all major frameworks. we have to Transform the widget tree to stack the video as a background to properly render it.
E. Tree Transformation
Related Documents
Tokenization
Factors to consider
0
*
1
*
color
background-color(node)
Container()
1
*
gradient
background-gradient(node)
Container()
1
*
image
true
false
false
background-image(node)
Container()
1
0
image
true
false
false
image()
Image()
{ use_image_widget_if_possible: true }
1
*
video
true
background-video
Stack(Video(), Container())
Stack
asVideo
along with the node itself as aContainer
>1
*
color[]
[background-color(node)]
Container(...)
>1
*
gradient[]
[background-gradient(node)]
Container(...)
>1
*
image[]
true
false
false
[background-image(node)]
Container(...)
>1
0
image[]
true
false
false
Stack(image()[])
Image()
{ use_image_widget_if_possible: true }
>1
*
video[]
true
background-video-many
Stack(Video()[], Container())
Stack
asVideo[]
along with the node itself as aContainer
>1
*
mixed
false
false
background(node)
Container(...)
>1
*
mixed
false
false
background(node)
Container(...)