import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; // ignore: must_be_immutable class ElevationBtn extends StatefulWidget { ElevationBtn( {this.text, this.color, required this.onPressed, this.textcolor}); String? text; Color? color; final VoidCallback onPressed; Color? textcolor; @override State createState() => _ElevationBtnState(); } class _ElevationBtnState extends State { @override Widget build(BuildContext context) { return ElevatedButton( onPressed: widget.onPressed, style: ElevatedButton.styleFrom( backgroundColor: widget.color?.withOpacity(0.9), ), child: Text( widget.text!, style: TextStyle(color: widget.textcolor), ), ); } }