chatImage static method

Widget chatImage(
  1. BuildContext context,
  2. String id,
  3. dynamic listMessage,
  4. String? chatContent,
  5. int index,
  6. bool logUserMsg,
)

Implementation

static Widget chatImage(BuildContext context, String id, var listMessage,
    String? chatContent, int index, bool logUserMsg) {
  return Container(
    child: ElevatedButton(
        child: Material(
          child: kIsWeb
              ? widgetShowImages(chatContent!, 250)
              : widgetShowImages(chatContent!, 100),
          borderRadius: BorderRadius.all(Radius.circular(10.0)),
          clipBehavior: Clip.hardEdge,
        ),
        onPressed: () {
          Navigator.push(
              context,
              MaterialPageRoute(
                  builder: (context) => ZoomImage(url: chatContent)));
        },
        style: ElevatedButton.styleFrom(padding: EdgeInsets.all(10.0))),
    margin: logUserMsg
        ? EdgeInsets.only(
            bottom: ChatData.isLastMessageRight(listMessage, id, index)
                ? 20.0
                : 10.0,
            right: 10.0)
        : EdgeInsets.only(left: 10.0),
  );
}