material_neumorphic_toggle

Last updated:

0 purchases

material_neumorphic_toggle Image
material_neumorphic_toggle Images
Add to Cart

Description:

material neumorphic toggle

Material Neumorphic Toggle Button Group #
Part of Material Neumorphic widgets suit.
Usage #
Switch with custom thumb (defined with list of ToggleElements)
Widget does not save state

notifies a ValueChanged<int> : onChanged
need a selectedIndex parameter

Expanded(
child: NeumorphicToggle(
height: 50,
selectedIndex: _selectedIndex,
displayForegroundOnlyIfSelected: true,
children: [
ToggleElement(
background: Center(child: Text("This week", style: TextStyle(fontWeight: FontWeight.w500),)),
foreground: Center(child: Text("This week", style: TextStyle(fontWeight: FontWeight.w700),)),
),
ToggleElement(
background: Center(child: Text("This month", style: TextStyle(fontWeight: FontWeight.w500),)),
foreground: Center(child: Text("This month", style: TextStyle(fontWeight: FontWeight.w700),)),
),
ToggleElement(
background: Center(child: Text("This year", style: TextStyle(fontWeight: FontWeight.w500),)),
foreground: Center(child: Text("This year", style: TextStyle(fontWeight: FontWeight.w700),)),
)
],
thumb: Neumorphic(
boxShape: NeumorphicBoxShape.roundRect(borderRadius: BorderRadius.all(Radius.circular(12))),
),
onChanged: (value) {
setState(() {
_selectedIndex = value;
print("_firstSelected: $_selectedIndex");
});
},
),
),
copied to clipboard

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.