You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cloudsolutions-atoms/lib/new_views/common_widgets/app_filled_button.dart

40 lines
1.2 KiB
Dart

import 'package:flutter/material.dart';
import 'package:test_sa/extensions/context_extension.dart';
import 'package:test_sa/extensions/int_extensions.dart';
import 'package:test_sa/extensions/string_extensions.dart';
import 'package:test_sa/models/enums/translation_keys.dart';
class AppFilledButton extends StatelessWidget {
final VoidCallback onPressed;
final TranslationKeys label;
final bool maxWidth;
const AppFilledButton({
@required this.onPressed,
@required this.label,
this.maxWidth = false,
Key key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return SizedBox(
width: maxWidth ? double.infinity : null,
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 16,
vertical: 20,
),
child: ElevatedButton(
style: ElevatedButton.styleFrom(
elevation: 0,
padding: EdgeInsets.symmetric(vertical: 16.toScreenHeight),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
),
onPressed: onPressed,
child: context.translate(label).toHeading6(context, color: Theme.of(context).floatingActionButtonTheme.foregroundColor),
),
),
);
}
}