31 lines
679 B
Dart
31 lines
679 B
Dart
|
import 'package:flutter/material.dart';
|
||
|
|
||
|
class MyButton extends StatelessWidget {
|
||
|
void Function()? onTap;
|
||
|
final String text;
|
||
|
|
||
|
MyButton({
|
||
|
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.secondary,
|
||
|
borderRadius: BorderRadius.circular(8),
|
||
|
),
|
||
|
padding: const EdgeInsets.all(25),
|
||
|
margin: const EdgeInsets.symmetric(horizontal: 25),
|
||
|
child: Center(
|
||
|
child: Text(text),
|
||
|
),
|
||
|
),
|
||
|
);
|
||
|
}
|
||
|
}
|