messageCard method

Widget messageCard(
  1. int type
)

Implementation

Widget messageCard(int type) {
  switch (type) {
    case 0:
      return const MessageCard(
        text: 'hello World!',
        date: '12:00 PM',
        isSender: true,
        sent: true,
      );
    case 1:
      return ImageCard(
        id: (type+Random().nextInt(1000)).toString(),
        image: Image.network('https://via.placeholder.com/150'),
        date: '12:00 PM',
        isSender: false,
        sent: true,
      );
    default:
      return const MessageCard(
        text: 'hello World!',
        date: '12:00 PM',
        isSender: false,
        sent: true,
      );

  }
}