build method

  1. @override
Widget build(
  1. BuildContext context
)
override

Describes the part of the user interface represented by this widget.

The framework calls this method when this widget is inserted into the tree in a given BuildContext and when the dependencies of this widget change (e.g., an InheritedWidget referenced by this widget changes). This method can potentially be called in every frame and should not have any side effects beyond building a widget.

The framework replaces the subtree below this widget with the widget returned by this method, either by updating the existing subtree or by removing the subtree and inflating a new subtree, depending on whether the widget returned by this method can update the root of the existing subtree, as determined by calling Widget.canUpdate.

Typically implementations return a newly created constellation of widgets that are configured with information from this widget's constructor and from the given BuildContext.

The given BuildContext contains information about the location in the tree at which this widget is being built. For example, the context provides the set of inherited widgets for this location in the tree. A given widget might be built with multiple different BuildContext arguments over time if the widget is moved around the tree or if the widget is inserted into the tree in multiple places at once.

The implementation of this method must only depend on:

If a widget's build method is to depend on anything else, use a StatefulWidget instead.

See also:

  • StatelessWidget, which contains the discussion on performance considerations.

Implementation

@override
Widget build(BuildContext context) {
  return Scaffold(
    appBar: AppBar(
      title: const Text('James Wagon'),
    ),
    body: Container(
      width: MediaQuery.of(context).size.width,
      height: MediaQuery.of(context).size.height,
      decoration: const BoxDecoration(
        color: AppColors.backgroundColor,
      ),
      child: SingleChildScrollView(
        child: Padding(
          padding:
              const EdgeInsets.only(left: 20, right: 20, bottom: 20, top: 2),
          child: Column(
            children: [
              VengamoChatUI(
                senderBgColor: AppColors.softGreenColor,
                receiverBgColor: AppColors.white,
                isSender: true,
                isNextMessageFromSameSender: false,
                time: getTime(),
                isAudio: true,
                audioSource:
                    'http://www.uscis.gov/files/nativedocuments/Track%2093.mp3',
                timeLabelColor: AppColors.iconColor,
                pointer: true,
                ack: Image.asset(
                  'assets/images/seen.png',
                  height: 12,
                  width: 12,
                ),
              ),
              const SizedBox(
                height: 10,
              ),
              VengamoChatUI(
                senderBgColor: AppColors.softGreenColor,
                receiverBgColor: AppColors.white,
                isSender: false,
                isNextMessageFromSameSender: false,
                time: getTime(),
                isAudio: true,
                messageReply:const Text("Why did the sun never want to join"),
                audioSource:
                    'https://weellu.s3.amazonaws.com/f8f34cbe-fba4-4935-8a0a-718cd2192615.mp3',
                timeLabelColor: AppColors.iconColor,
                pointer: true,
                ack: Image.asset(
                  'assets/images/seen.png',
                  height: 12,
                  width: 12,
                ),
              ),
              const SizedBox(height: 10,),
                  VengamoChatUI(
                senderBgColor: AppColors.softGreenColor,
                receiverBgColor: AppColors.white,
                timeLabelColor: AppColors.darkModeBackgroundColor,
                isSender: false,
                isNextMessageFromSameSender: false,
                imgUrl : 'https://images.unsplash.com/photo-1687360441042-a3eb360f3db1?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=2787&q=80',
                caption : const Text("check this out! Why don't skeletons fight each other? They don't have the guts!"),
                time: getTime(),
                pointer: true,
                ack: Image.asset(
                  'assets/images/seen.png',
                  height: 12,
                  width: 12,
                ),
              ),
              const SizedBox(
                height: 10,
              ),
              VengamoChatUI(
                senderBgColor: AppColors.softGreenColor,
                receiverBgColor: AppColors.white,
                isSender: false,
                timeLabelColor: AppColors.iconColor,
                isNextMessageFromSameSender: false,
                imgUrl: 'https://cdn.wallpapersafari.com/28/2/vrIzJD.jpg',
                time: getTime(),
                messageReply: const Text("It's Crazy time fly fast"),
                pointer: true,
                ack: Image.asset(
                  'assets/images/seen.png',
                  height: 12,
                  width: 12,
                ),
              ),
              const SizedBox(
                height: 10,
              ),
              VengamoChatUI(
                senderBgColor: AppColors.softGreenColor,
                receiverBgColor: AppColors.white,
                isSender: false,
                timeLabelColor: AppColors.iconColor,
                isNextMessageFromSameSender: false,
                imgUrl:
                    'https://weellu.s3.us-east-2.amazonaws.com/test/kYFhiApyyVRX.jpeg',
                time: getTime(),
                messageReply:const Text("Why did the sun never want to join"),
                pointer: true,
                ack: Image.asset(
                  'assets/images/seen.png',
                  height: 12,
                  width: 12,
                ),
              ),
              VengamoChatUI(
                senderBgColor: AppColors.softGreenColor,
                receiverBgColor: AppColors.white,
                isSender: true,
                isNextMessageFromSameSender: false,
                time: getTime(),
                timeLabelColor: AppColors.softBlackcolor,
                text: const Text(
                  "Yolla ✋ Hey, guess what?",
                  style: TextStyle(fontSize: 16),
                  maxLines: 2,
                  overflow: TextOverflow.ellipsis,
                ),
                pointer: true,
                ack: const Icon(
                  Icons.check,
                  color:
                      AppColors.iconColor, // You can customize the color here
                  size: 13, // You can customize the size here
                ),
              ),
              VengamoChatUI(
                senderBgColor: AppColors.softGreenColor,
                receiverBgColor: AppColors.white,
                isSender: true,
                isNextMessageFromSameSender: true,
                time: getTime(),
                timeLabelColor: AppColors.softBlackcolor,
                 text: const Text(
                  "What?",
                  style: TextStyle(fontSize: 16),
                  maxLines: 2,
                  overflow: TextOverflow.ellipsis,
                ),
                pointer: false,
                ack: Image.asset(
                  'assets/images/double_tick_grey.png',
                  height: 13,
                  width: 13,
                ),
              ),
              VengamoChatUI(
                senderBgColor: AppColors.softGreenColor,
                receiverBgColor: AppColors.white,
                isSender: false,
                isNextMessageFromSameSender: false,
                time: getTime(),
                text: const Text(
                  "I invented a new word!.",
                  style: TextStyle(fontSize: 16),
                  maxLines: 2,
                  overflow: TextOverflow.ellipsis,
                ),
                pointer: true,
                ack: Image.asset(
                  'assets/images/double_tick_green.png',
                  height: 14,
                  width: 15,
                ),
              ),
              const SizedBox(
                height: 5,
              ),

              VengamoChatUI(
                senderBgColor: AppColors.softGreenColor,
                receiverBgColor: AppColors.white,
                timeLabelColor: AppColors.darkModeBackgroundColor,
                isSender: true,
                isNextMessageFromSameSender: false,
                imgUrl: 'https://wallpaperaccess.com/full/1248267.jpg',
                caption: const Text("Ma douce étoile, Telle une fleur en épanouissement, 🌸 Ton charme éblouit, 🌈 Mon cœur danse au son de ton rire joyeux. 🎶 Tes yeux, deux éclats d'amour, 💖 Illuminent mon monde sombre, 🌌 Comme des étoiles scintillant dans la nuit, 🌠 Ta beauté, une éternelle splendeur. 🌺 Ta douceur, telle une brise légère, 🍃 Enveloppe mon âme de tendresse, 🌬️ Chaque mot que tu prononces, 💬 Est une mélodie sucrée, une délicieuse caresse. 🎵 Mon amour pour toi, infini comme l'horizon, 🌅 S'étend au-delà des montagnes, 🏔️ Comme un jardin sans fin de roses éternelles, 🌹 Chaque pétale, un éclat de notre histoire. 📜💕 Ma chère muse, 🎨 Toi, mon bonheur, mon abri sûr, 🏡 Dans le jardin de notre amour, 🌷 Fleurit l'éternité de notre bonheur. 🌼💑", style: TextStyle(
                  fontSize: 14,
                )),
                messageReply:const Text("Pour récupérer vos conversations WhatsApp, il vous suffit de désinstaller et réinstaller l'application. À l'ouverture, celle-ci vous demandera de vérifier votre numéro de téléphone et vous"),
                time: getTime(),
                pointer: true,
                ack: Image.asset(
                  'assets/images/seen.png',
                  height: 12,
                  width: 12,
                ),
              ),
              VengamoChatUI(
                name: const Text('Eric Hagumimana', style: TextStyle(color: Colors.amberAccent, fontSize: 17),),
                senderBgColor: AppColors.softGreenColor,
                receiverBgColor: AppColors.white,
                isSender: false,
                isNextMessageFromSameSender: true,
                time: getTime(),
                text: const Text(
                  "Ma douce étoile, Telle une fleur en épanouissement, 🌸 Ton charme éblouit, 🌈 Mon cœur danse au son de ton rire joyeux. 🎶 Tes yeux, deux éclats d'amour, 💖 Illuminent mon monde sombre, 🌌 Comme des étoiles scintillant dans la nuit, 🌠 Ta beauté, une éternelle splendeur. 🌺 Ta douceur, telle une brise légère, 🍃 Enveloppe mon âme de tendresse, 🌬️ Chaque mot que tu prononces, 💬 Est une mélodie sucrée, une délicieuse caresse. 🎵 Mon amour pour toi, infini comme l'horizon, 🌅 S'étend au-delà des montagnes, 🏔️ Comme un jardin sans fin de roses éternelles, 🌹 Chaque pétale, un éclat de notre histoire. 📜💕 Ma chère muse, 🎨 Toi, mon bonheur, mon abri sûr, 🏡 Dans le jardin de notre amour, 🌷 Fleurit l'éternité de notre bonheur. 🌼💑",
                  style: TextStyle(fontSize: 16),
                  maxLines: 2,
                  overflow: TextOverflow.ellipsis,
                ),
                pointer: false,
                ack: Image.asset(
                  'assets/images/double_tick_green.png',
                  height: 14,
                  width: 15,
                ),
              ),
              VengamoChatUI(
                name: const Text('Eric Hagumimana', style: TextStyle(color: Colors.amberAccent, fontSize: 17),),
                senderBgColor: AppColors.softGreenColor,
                receiverBgColor: AppColors.white,
                isSender: false,
                isNextMessageFromSameSender: true,
                time: getTime(),
                text: const Text(
                  "Plagiarism! 💫 😂 ",
                  style: TextStyle(fontSize: 16),
                  maxLines: 2,
                  overflow: TextOverflow.ellipsis,
                ),
                pointer: false,
                ack: Image.asset(
                  'assets/images/double_tick_green.png',
                  height: 14,
                  width: 15,
                ),
              ),
              VengamoChatUI(
                senderBgColor: AppColors.softGreenColor,
                receiverBgColor: AppColors.white,
                isSender: true,
                isNextMessageFromSameSender: false,
                time: getTime(),
                text: const Text(
                  "Plagiarism!? 😂.",
                  style: TextStyle(fontSize: 16),
                  maxLines: 2,
                  overflow: TextOverflow.ellipsis,
                ),
                 messageReply: const Text('Yola, what is popin'),
                pointer: true,
                ack: Image.asset(
                  'assets/images/sent.png',
                  height: 12,
                  width: 12,
                ),
              ),

              VengamoChatUI(
                senderBgColor: AppColors.softGreenColor,
                receiverBgColor: AppColors.white,
                isSender: true,
                isNextMessageFromSameSender: true,
                time: getTime(),
                 text: const Text(
                  "Thanks! I thought you'd like it 🤪",
                  style: TextStyle(fontSize: 16),
                  maxLines: 2,
                  overflow: TextOverflow.ellipsis,
                ),
                pointer: false,
                ack: Image.asset(
                  'assets/images/seen.png',
                  height: 12,
                  width: 12,
                ),
              ),
              VengamoChatUI(
                senderBgColor: AppColors.softGreenColor,
                receiverBgColor: AppColors.white,
                isSender: true,
                isNextMessageFromSameSender: true,
                messageReply:const Text("Pour récupérer vos conversations WhatsApp, il vous suffit de désinstaller et réinstaller l'application. À l'ouverture, celle-ci vous demandera de vérifier votre numéro de téléphone et vous"),
                time: getTime(),
                 text: const Text(
                  "Why don't scientists!",
                  style: TextStyle(fontSize: 16),
                  maxLines: 2,
                  overflow: TextOverflow.ellipsis,
                ),
                pointer: false,
                ack: Image.asset(
                  'assets/images/seen.png',
                  height: 12,
                  width: 12,
                ),
              ),

              VengamoChatUI(
                textStyle: const TextStyle(fontSize: 16),
                senderBgColor: AppColors.softGreenColor,
                receiverBgColor: AppColors.white,
                isSender: false,
                isNextMessageFromSameSender: false,
                time: getTime(),
                text: const Text(
                  "check this out! Why do",
                  style: TextStyle(fontSize: 16),
                  maxLines: 2,
                  overflow: TextOverflow.ellipsis,
                ),
                pointer: true,
                messageReply:const Text("You look amazing bros, hear more jokes or have any other questions, feel free to ask.😂🤪"),
                ack: Image.asset(
                  'assets/images/seen.png',
                  height: 12,
                  width: 12,
                ),
              ),

                 VengamoChatUI(
                  senderBgColor: AppColors.softGreenColor,
                  receiverBgColor: AppColors.white,
                  isSender: true,
                  isNextMessageFromSameSender: false,
                  text: const Text("Dear package maintainer, vengamosocial@gmail.com has published a new version (1.3.9) of the vengamo_chat_ui package to the Dart package site (pub.dev). For details, go to https://pub.dev/packages/vengamo_chat_ui/versions/1.3.9 If you have any concerns about this package, contact support@pub.dev Thanks for your contributions to the Dart community! With appreciation, the Dart package site admin", style: TextStyle(fontSize: 16),maxLines: 2,
                  overflow: TextOverflow.ellipsis),
                  messageReply: const Text("Dear package maintainer, vengamosocial@gmail.com has published a new version (1.3.9) of the vengamo_chat_ui package to the Dart package site (pub.dev). For details, go to https://pub.dev/packages/vengamo_chat_ui/versions/1.3.9 If you have any concerns about this package, contact support@pub.dev Thanks for your contributions to the Dart community! With appreciation, the Dart package site admin", style: TextStyle(fontSize: 16),),
                  time: getTime(),
                  timeLabelColor: AppColors.iconColor,
                  pointer: false,
                  ack: Image.asset(
                    'assets/images/seen.png',
                    height: 12,
                    width: 12,
                  )
                ),
                VengamoChatUI(
                name: const Text("Eric Weeb"),
                audioSource: "https://weellu.s3.amazonaws.com/c2fba70d-78c4-4beb-91db-5054ae70499e.mp3",
                isAudio: true,
                senderBgColor: AppColors.softGreenColor,
                receiverBgColor: AppColors.white,
                timeLabelColor: AppColors.darkModeBackgroundColor,
                isSender: true,
                isNextMessageFromSameSender: false,
                time: getTime(),
                imageStyles: const BoxConstraints(maxWidth: 300, maxHeight: 350),
                // messageReply: const Text('Yola, what is popin up'),
                pointer: true,
                ack: Image.asset(
                  'assets/images/seen.png',
                  height: 12,
                  width: 12,
                ),
              )
            ],
          ),
        ),
      ),
    ), // Use Vengamo Chat UI component here
  );
}