32 lines
792 B
Dart
32 lines
792 B
Dart
|
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),
|
||
|
),
|
||
|
);
|
||
|
}
|
||
|
}
|