match_magic/lib/widgets/gradient_button.dart

40 lines
1.1 KiB
Dart
Raw Permalink Normal View History

import 'package:flutter/material.dart';
import 'package:match_magic/styles/styles.dart';
class GradientButton extends StatelessWidget {
final VoidCallback onPressed;
final String buttonText;
const GradientButton({
Key? key,
required this.onPressed,
required this.buttonText,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
height: 40,
decoration: const BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(100)),
gradient: AppStyles.buttonGradient),
child: ElevatedButton(
onPressed: onPressed,
style: ElevatedButton.styleFrom(
backgroundColor: Colors.transparent,
shadowColor: Colors.transparent,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(100),
),
),
child: Text(
buttonText.toUpperCase(),
style: const TextStyle(
color: AppStyles.buttonPrimaryDefaultText,
fontWeight: FontWeight.w700),
),
),
);
}
}