firebaseUIButton function

Container firebaseUIButton(
  1. BuildContext context,
  2. String title,
  3. bool? hasEmailText,
  4. bool? hasPasswordText,
  5. bool? hasUserNameText,
  6. Function? onTap,
)

Implementation

Container firebaseUIButton(BuildContext context, String title,bool? hasEmailText, bool? hasPasswordText, bool? hasUserNameText, Function? onTap) {
  return Container(
    width: MediaQuery.of(context).size.width,
    height: 50,
    margin: const EdgeInsets.fromLTRB(0, 10, 0, 20),
    decoration: BoxDecoration(borderRadius: BorderRadius.circular(90)),
    child: ElevatedButton(
      onPressed: (hasEmailText! || hasPasswordText! || hasUserNameText!) ? () {
        onTap!();
      }:null,
      style: ButtonStyle(
          backgroundColor: MaterialStateProperty.resolveWith((states) {
            if (states.contains(MaterialState.pressed)) {
              return Colors.black38;
            }
            return Colors.grey;
          }),
          shape: MaterialStateProperty.all<RoundedRectangleBorder>(
              RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)))),
      child: Text(
        title,
        style: const TextStyle(
            color: Colors.black87, fontWeight: FontWeight.bold, fontSize: 16),
      ),
    ),
  );
}