2022-05-16 22:41:00 +00:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
class FilledButton extends StatelessWidget {
|
|
|
|
const FilledButton({
|
|
|
|
Key? key,
|
|
|
|
this.onPressed,
|
|
|
|
this.title,
|
|
|
|
this.child,
|
|
|
|
}) : super(key: key);
|
|
|
|
|
|
|
|
final VoidCallback? onPressed;
|
|
|
|
final String? title;
|
|
|
|
final Widget? child;
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return ElevatedButton(
|
|
|
|
onPressed: onPressed,
|
|
|
|
style: ElevatedButton.styleFrom(
|
|
|
|
onPrimary: Theme.of(context).colorScheme.onPrimary,
|
|
|
|
primary: Theme.of(context).colorScheme.primary,
|
|
|
|
).copyWith(elevation: ButtonStyleButton.allOrNull(0.0)),
|
2022-05-24 18:55:39 +00:00
|
|
|
child: child ?? Text(title ?? ''),
|
2022-05-16 22:41:00 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|