selfprivacy.org.app/lib/ui/components/brand_button/FilledButton.dart
2022-05-17 01:41:00 +03:00

27 lines
658 B
Dart

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,
child: child ?? Text(title ?? ''),
style: ElevatedButton.styleFrom(
onPrimary: Theme.of(context).colorScheme.onPrimary,
primary: Theme.of(context).colorScheme.primary,
).copyWith(elevation: ButtonStyleButton.allOrNull(0.0)),
);
}
}