cofounderella/lib/components/my_button.dart

32 lines
735 B
Dart
Raw Permalink Normal View History

2024-04-29 14:36:25 +02:00
import 'package:flutter/material.dart';
import 'text_bold.dart';
2024-04-29 14:36:25 +02:00
class MyButton extends StatelessWidget {
2024-05-16 16:57:17 +02:00
final void Function()? onTap;
2024-04-29 14:36:25 +02:00
final String text;
2024-05-16 16:57:17 +02:00
const MyButton({
2024-04-29 14:36:25 +02:00
super.key,
required this.text,
required this.onTap,
});
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: onTap,
child: Container(
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.secondaryContainer,
2024-04-29 14:36:25 +02:00
borderRadius: BorderRadius.circular(8),
),
2024-04-30 22:33:01 +02:00
padding: const EdgeInsets.all(16),
2024-04-29 14:36:25 +02:00
margin: const EdgeInsets.symmetric(horizontal: 25),
child: Center(
child: TextBold(text: text),
2024-04-29 14:36:25 +02:00
),
),
);
}
}