Skip to content

[Views] - shadow modifier method #31

@suragch

Description

@suragch

In SwiftUI you add shadow to a View with the shadow modifier method:

Screenshot 2024-06-15 at 08 27 34
Rectangle()
    .fill(Color.purple)
    .shadow(color: .gray, radius: 10, x: 0, y: 10)
    .frame(width: 200, height: 100)

Note that this is a method on View and not on Shape. See #27. For that reason, shadows can be applied to any view. So in Flutter, we can make this a composable widget:

Shadow(
  color: Colors.grey,
  radius: 10.0,
  x: 0.0,
  y: 10.0,
  child: AnyWidget(),
)

Tasks:

  • Create SwiftUI examples
  • Implement Flutter widget with doc comments
  • Create Flutter examples
  • Add golden tests

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions