Flutter-Neumorphic icon indicating copy to clipboard operation
Flutter-Neumorphic copied to clipboard

clip shadows in list

Open Phat0M opened this issue 5 years ago • 1 comments

Аннотация 2020-10-06 204142 Shadows are cropped by the limitations of the parent widget. Is it possible to draw shadows even under neighboring widgets?

Phat0M avatar Oct 06 '20 17:10 Phat0M

I have a similiar problem:

My darkTheme is as follows:

NeumorphicThemeData.dark(
        accentColor: Colors.lightBlueAccent,
        defaultTextColor: Colors.white,
        lightSource: LightSource.topLeft,
        shadowLightColor: Colors.red, // for better visibility in the image below
        shadowLightColorEmboss: Colors.grey[700],
        shadowDarkColor: Colors.black,
        shadowDarkColorEmboss: Colors.black,
)

When I use a NeumorphicToggle like this:

NeumorphicToggle(
  style: NeumorphicToggleStyle(
    disableDepth: false,
  ),
  thumb: null,
  children: [
    ToggleElement(
      background: Center(child: Text("male", style: TextStyle(fontWeight: FontWeight.w500))),
      foreground: Center(child: Text("male", style: TextStyle(fontWeight: FontWeight.w700))),
    ),
    ToggleElement(
      background: Center(child: Text("female", style: TextStyle(fontWeight: FontWeight.w500))),
      foreground: Center(child: Text("female", style: TextStyle(fontWeight: FontWeight.w700))),
    ),
  ],
),

the shadowLightColor gets clipped as you can see in the image below:

Clipped shadow

JulianAssmann avatar Jan 20 '21 20:01 JulianAssmann