memberItem function

Widget memberItem({
  1. required String name,
  2. required String image,
  3. required String status,
  4. bool? isAdmin,
  5. required dynamic onTap(),
  6. String spantext = Constants.emptyString,
  7. bool isCheckBoxVisible = false,
  8. bool isChecked = false,
  9. dynamic onchange(
    1. bool? value
    )?,
  10. bool isGroup = false,
  11. required bool blocked,
  12. required bool unknown,
})

Implementation

Widget memberItem(
    {required String name,
    required String image,
    required String status,
    bool? isAdmin,
    required Function() onTap,
    String spantext = Constants.emptyString,
    bool isCheckBoxVisible = false,
    bool isChecked = false,
    Function(bool? value)? onchange,
    bool isGroup = false,
    required bool blocked,
    required bool unknown}) {
  var titlestyle = TextStyle(
      color: MirrorflyUikit.getTheme?.textPrimaryColor ?? Colors.black,
      fontSize: 14.0,
      fontWeight: FontWeight.w700);
  return Container(
    padding: const EdgeInsets.symmetric(vertical: 4.0),
    child: InkWell(
      onTap: onTap,
      child: Column(
        children: [
          Padding(
            padding: const EdgeInsets.only(
                right: 16.0, left: 16.0, top: 4, bottom: 4),
            child: Row(
              children: [
                ImageNetwork(
                  url: image.checkNull(),
                  width: 48,
                  height: 48,
                  clipOval: true,
                  errorWidget: name.checkNull().isNotEmpty
                      ? ProfileTextImage(
                          fontSize: 20,
                          text: name.checkNull(),
                        )
                      : null,
                  blocked: blocked,
                  unknown: unknown,
                  isGroup: isGroup,
                ),
                Expanded(
                  child: Padding(
                    padding: const EdgeInsets.all(8.0),
                    child: Column(
                      mainAxisAlignment: MainAxisAlignment.start,
                      crossAxisAlignment: CrossAxisAlignment.start,
                      mainAxisSize: MainAxisSize.min,
                      children: [
                        spantext.isEmpty
                            ? Text(
                                name.checkNull(),
                                style: titlestyle,
                                maxLines: 1,
                                overflow: TextOverflow.ellipsis, //TextStyle
                              )
                            : spannableText(
                                name.checkNull(),
                                spantext,
                                titlestyle,
                              ),
                        Text(
                          status.checkNull(),
                          style: TextStyle(
                            color:
                                MirrorflyUikit.getTheme?.textSecondaryColor ??
                                    Colors.black,
                            fontSize: 12.0,
                          ),
                          maxLines: 1,
                          overflow: TextOverflow.ellipsis,
                        ),
                      ],
                    ),
                  ),
                ),
                (isAdmin != null && isAdmin)
                    ? Text("Admin",
                        style: TextStyle(
                          color: MirrorflyUikit.getTheme?.primaryColor ??
                              buttonBgColor,
                          fontSize: 12.0,
                        ))
                    : const SizedBox(),
                Visibility(
                  visible: isCheckBoxVisible,
                  child: Theme(
                    data: ThemeData(
                      unselectedWidgetColor: Colors.grey,
                    ),
                    child: Checkbox(
                      activeColor:
                          MirrorflyUikit.getTheme!.primaryColor, //Colors.white,
                      checkColor: MirrorflyUikit.getTheme?.colorOnPrimary,
                      value: isChecked,
                      onChanged: onchange,
                    ),
                  ),
                ),
              ],
            ),
          ),
          const AppDivider(
              padding: EdgeInsets.only(right: 16, left: 75, top: 4))
        ],
      ),
    ),
  );
}