making style Widget dynamic for elevated button

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),
);
}
}`


I want to make the
style widget dynamic, I mean ElevatedButton.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.

Leave a Comment

Your email address will not be published. Required fields are marked *

Discover more from Coursity

Subscribe now to keep reading and get access to the full archive.

Continue reading

Scroll to Top
Choosing your web development specialization : front end, back end, or full stack ?. Top micro jobs sites to make money online.