Created
March 7, 2025 19:51
-
-
Save Lxxyx/215ce120bd8b5f08ea77a15f078ecd24 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FancyButton extends StatelessWidget { | |
final String text; | |
final Function onPressed; | |
const FancyButton({required this.text, required this.onPressed, super.key}); | |
@override | |
Widget build(BuildContext context) { | |
return Container( | |
width: double.infinity, | |
decoration: BoxDecoration( | |
borderRadius: BorderRadius.all(Radius.circular(30)), | |
gradient: LinearGradient( | |
colors: [Colors.purple, Colors.blue], | |
begin: Alignment.centerLeft, | |
end: Alignment.centerRight, | |
), | |
), | |
child: ElevatedButton( | |
onPressed: () { | |
onPressed(); | |
}, | |
style: ElevatedButton.styleFrom( | |
primary: Colors.transparent, | |
onPrimary: Colors.white, | |
shadowColor: Colors.transparent, | |
elevation: 0, | |
textStyle: const TextStyle(fontSize: 18, fontWeight: FontWeight.bold), | |
padding: const EdgeInsets.symmetric(vertical: 15), | |
), | |
child: Text(text), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment