buttonCard static method

Widget buttonCard({
  1. required String title,
  2. String? subtitle,
  3. required IconData iconData,
  4. required VoidCallback handler,
  5. bool isTrailing = false,
  6. bool underlined = true,
  7. Color? textColor,
  8. required Color iconColor,
  9. double? iconSize,
  10. double? arrowSize,
  11. bool showBadge = false,
})

Implementation

static Widget buttonCard({
  required String title,
  String? subtitle,
  required IconData iconData,
  required VoidCallback handler,
  bool isTrailing = false,
  bool underlined = true,
  Color? textColor,
  required Color iconColor,
  double? iconSize,
  double? arrowSize,
  bool showBadge = false,
}) {
  return Column(
    children: [
      InkWell(
        onTap: handler,
        child: Container(
          margin: EdgeInsets.all(10.spMin),
          padding: EdgeInsets.all(10.spMin),
          child: Row(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: [
              Row(
                children: [
                  Icon(
                    iconData,
                    color: iconColor,
                    size: iconSize,
                  ),
                  SizedBox(
                    width: 20.w,
                  ),
                  Column(
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: [
                      Texts.body1(
                        title,
                        color: textColor,
                      ),
                      SizedBox(
                        height: 5.h,
                      ),
                      subtitle != null
                          ? Texts.body2(
                              subtitle,
                              color: Colors.grey,
                            )
                          : const SizedBox(),
                    ],
                  ),
                ],
              ),
              isTrailing
                  ? badges.Badge(
                      showBadge: showBadge,
                      child: Icon(
                        Icons.chevron_right,
                        size: arrowSize,
                      ),
                    )
                  : const SizedBox(),
            ],
          ),
        ),
      ),
      underlined
          ? Divider(
              height: 0.h,
              thickness: .5,
            )
          : const SizedBox(),
    ],
  );
}