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

39 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/text_extensions.dart';
import 'package:test_sa/extensions/widget_extensions.dart';
import 'package:test_sa/models/enums/translation_keys.dart';
import 'package:test_sa/new_views/app_style/app_color.dart';
class AppFilledButton extends StatelessWidget {
final VoidCallback onPressed;
final String label;
final bool maxWidth;
final Color buttonColor;
final Color textColor;
const AppFilledButton({
@required this.onPressed,
@required this.label,
this.maxWidth = false,
this.buttonColor,
this.textColor,
Key key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
height: 56.toScreenHeight,
width: maxWidth ? double.infinity : null,
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: buttonColor ?? Theme.of(context).primaryColor,
),
child: label.heading6(context).custom(color: textColor ?? (context.isDark ? AppColor.neutral60 : Colors.white)),
).onPress(onPressed);
}
}