buildSigninBtn static method
Widget
buildSigninBtn(
{ - required BuildContext context,
- required Widget icon,
- required String text,
- required dynamic onClick(),
- required Color containerColor,
- required Color textColor,
- Color borderColor = LoginColors.lightGreyColor,
})
Implementation
static Widget buildSigninBtn({
required BuildContext context,
required Widget icon,
required String text,
required Function() onClick,
required Color containerColor,
required Color textColor,
Color borderColor = LoginColors.lightGreyColor,
}) {
LoginThemeData? loginThemeData = LoginTheme.of(context);
LoginButtonThemeData loginButtonThemeData =
loginThemeData?.loginButtonThemeData ??
LoginButtonThemeData.roundedRectangle(borderColor: borderColor);
return ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor: containerColor,
padding: const EdgeInsets.symmetric(horizontal: 16),
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(25)),
),
).merge(
ButtonStyle(elevation: MaterialStateProperty.resolveWith<double>((Set<MaterialState> states) {
if (states.contains(MaterialState.pressed)) return loginButtonThemeData.elevation ?? 0;
return 0;
})),
),
onPressed: () {
onClick.call();
},
child: _buildButtonContent(icon, text, textColor),
);
}