DiscoverModule/lib/custom_widget/elevation_btn.dart

32 lines
792 B
Dart
Raw Normal View History

2024-05-20 10:29:02 +00:00
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<ElevationBtn> createState() => _ElevationBtnState();
}
class _ElevationBtnState extends State<ElevationBtn> {
@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),
),
);
}
}