KonectarApp/lib/contacts_module/custom_widget/elevation_btn.dart

32 lines
792 B
Dart
Raw Normal View History

2024-10-08 12:01:59 +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),
),
);
}
}