I am trying to create a dynamic elevated button widget.
`class CustomeElevatedBtn extends StatelessWidget {
const CustomeElevatedBtn(
{required this.child_, required this.onPressed_, required this.style_});
final Widget child_;
final VoidCallback onPressed_;
final ??? style_;
@override
Widget build(BuildContext context) {
return ElevatedButton(
onPressed: onPressed_,
child: child_,
style: ElevatedButton.styleFrom(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(25),
),
padding: EdgeInsets.symmetric(horizontal: 16),
textStyle: TextStyle(fontSize: 14),
backgroundColor: Colors.orangeAccent,
foregroundColor: Colors.white),
);
}
}`
style widget dynamic, I mean
I want to make theElevatedButton.styleFrom
Widget also dynamic but I am unable to do so. How can I do it?
Discover more from Coursity
Subscribe to get the latest posts sent to your email.