Spaces:
Runtime error
Runtime error
| import 'package:flutter/material.dart'; | |
| class CustomButton extends StatelessWidget{ | |
| final Widget child; | |
| final VoidCallback onPressed; | |
| final EdgeInsets padding; | |
| final OutlinedBorder? shape; | |
| const CustomButton({ | |
| super.key, | |
| required this.onPressed, | |
| required this.child, | |
| this.padding = const EdgeInsets.symmetric(vertical:15,horizontal: 20), | |
| this.shape = const RoundedRectangleBorder( | |
| borderRadius: BorderRadius.all(Radius.circular(40)), | |
| ), | |
| }); | |
| Widget build(BuildContext context){ | |
| return ElevatedButton( | |
| onPressed: onPressed, | |
| style:ElevatedButton.styleFrom( | |
| padding:padding, | |
| shape: shape, | |
| ), | |
| child:child, | |
| ); | |
| } | |
| } |