downloadView function

Widget downloadView(
  1. int mediaFileSize,
  2. String messageType,
  3. bool isSentByMe
)

Implementation

Widget downloadView(int mediaFileSize, String messageType, bool isSentByMe) {
  return Padding(
    padding: const EdgeInsets.symmetric(horizontal: 8.0),
    child: messageType == Constants.mAudio || messageType == Constants.mDocument
        ? Container(
            decoration: BoxDecoration(
                border: Border.all(
                  color: isSentByMe
                      ? MirrorflyUikit
                          .getTheme!.chatBubblePrimaryColor.textSecondaryColor
                      : MirrorflyUikit.getTheme!.chatBubbleSecondaryColor
                          .textSecondaryColor,
                ),
                borderRadius: BorderRadius.circular(3)),
            padding: const EdgeInsets.all(5),
            child: SvgPicture.asset(
              package: package,
              downloadIcon,
              colorFilter: ColorFilter.mode(
                  isSentByMe
                      ? MirrorflyUikit
                          .getTheme!.chatBubblePrimaryColor.textSecondaryColor
                      : MirrorflyUikit.getTheme!.chatBubbleSecondaryColor
                          .textSecondaryColor,
                  BlendMode.srcIn), //playIconColor,
            ))
        : Container(
            width: 80,
            decoration: BoxDecoration(
              border: Border.all(
                color: isSentByMe
                    ? MirrorflyUikit
                        .getTheme!.chatBubblePrimaryColor.textSecondaryColor
                    : MirrorflyUikit.getTheme!.chatBubbleSecondaryColor
                        .textSecondaryColor, //textColor,
              ),
              borderRadius: const BorderRadius.all(Radius.circular(5)),
              color: isSentByMe
                  ? MirrorflyUikit.getTheme!.chatBubblePrimaryColor.color
                      .withOpacity(0.2)
                  : MirrorflyUikit.getTheme!.chatBubbleSecondaryColor.color
                      .withOpacity(0.2), //Colors.black38,
            ),
            padding: const EdgeInsets.symmetric(vertical: 5, horizontal: 10),
            child: Row(
              mainAxisAlignment: MainAxisAlignment.center,
              children: [
                SvgPicture.asset(
                  package: package,
                  downloadIcon,
                  colorFilter: ColorFilter.mode(
                      isSentByMe
                          ? MirrorflyUikit
                              .getTheme!.chatBubblePrimaryColor.textPrimaryColor
                          : MirrorflyUikit.getTheme!.chatBubbleSecondaryColor
                              .textPrimaryColor,
                      BlendMode.srcIn), //playIconColor,
                ),
                const SizedBox(
                  width: 5,
                ),
                Text(
                  Helper.formatBytes(mediaFileSize, 0),
                  style: TextStyle(
                      color: isSentByMe
                          ? MirrorflyUikit
                              .getTheme!.chatBubblePrimaryColor.textPrimaryColor
                          : MirrorflyUikit.getTheme!.chatBubbleSecondaryColor
                              .textPrimaryColor,
                      fontSize: 10),
                ),
              ],
            )),
  );
}