buttonCard2 static method

Widget buttonCard2({
  1. required String title,
  2. String? subtitle,
  3. required IconData iconData,
  4. required VoidCallback handler,
  5. bool isTrailing = false,
})

Implementation

static Widget buttonCard2({
  required String title,
  String? subtitle,
  required IconData iconData,
  required VoidCallback handler,
  bool isTrailing = false,
}) {
  return Column(
    children: [
      InkWell(
        onTap: handler,
        child: Container(
          margin: EdgeInsets.only(left: 10.w, right: 10.w),
          padding: EdgeInsets.only(top: 10.h, left: 10.w, right: 10.w),
          child: Row(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            crossAxisAlignment: CrossAxisAlignment.center,
            children: [
              Container(
                padding: EdgeInsets.all(10.spMin),
                decoration: BoxDecoration(
                  color: Get.theme.primaryColor.withAlpha(50),
                  borderRadius: BorderRadius.circular(15.r),
                ),
                child: Icon(
                  iconData,
                  color: Get.theme.primaryColor,
                  size: 35.spMin,
                ),
              ),
              Expanded(
                child: Column(
                  children: [
                    Padding(
                      padding: EdgeInsets.only(left: 10.w),
                      child: Row(
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        children: [
                          Column(
                            crossAxisAlignment: CrossAxisAlignment.start,
                            children: [
                              Texts.body1(title),
                              SizedBox(
                                height: 5.h,
                              ),
                              subtitle != null
                                  ? Texts.body2(
                                      subtitle,
                                      color: Colors.grey,
                                    )
                                  : const SizedBox(),
                            ],
                          ),
                          isTrailing
                              ? const Icon(
                                  Icons.chevron_right,
                                )
                              : const SizedBox(),
                        ],
                      ),
                    ),
                    SizedBox(
                      height: 10.h,
                    ),
                    Divider(
                      height: 0.h,
                      thickness: .3.h,
                    ),
                  ],
                ),
              )
            ],
          ),
        ),
      ),
    ],
  );
}