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

35 lines
1.1 KiB
Dart

import 'package:flutter/material.dart';
2 years ago
import 'package:test_sa/extensions/int_extensions.dart';
2 years ago
import 'package:test_sa/extensions/text_extensions.dart';
import 'package:test_sa/extensions/widget_extensions.dart';
2 years ago
import 'package:test_sa/new_views/app_style/app_color.dart';
class AppFilledButton extends StatelessWidget {
final VoidCallback onPressed;
final String label;
final bool maxWidth, loading;
2 years ago
final Color buttonColor;
final Color textColor;
const AppFilledButton({
@required this.onPressed,
@required this.label,
2 years ago
this.maxWidth = false,
this.loading = false,
2 years ago
this.buttonColor,
this.textColor,
Key key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
2 years ago
return Container(
2 years ago
height: 56.toScreenHeight,
width: maxWidth ? double.infinity : null,
alignment: Alignment.center,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(10), color: buttonColor ?? AppColor.blueStatus(context)),
child: label.heading6(context).custom(color: textColor ?? AppColor.background(context)),
2 years ago
).onPress(onPressed);
}
}