Flutter-Neumorphic
Flutter-Neumorphic copied to clipboard
clip shadows in list
Shadows are cropped by the limitations of the parent widget. Is it possible to draw shadows even under neighboring widgets?
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:
