Anas (May Allah be pleased with him) reported:
The Messenger of Allah (ﷺ) and his Companions reached Badr before the polytheists, and when they arrived, he (ﷺ) directed: "Let no one of you advance ahead of me." When the polytheists came near, the Messenger of Allah (ﷺ) said, "Now stand up and proceed towards Jannah which is as wide as are the heavens and the earth." 'Umair bin Al-Humam (May Allah be pleased with him) asked: "Is Jannah as wide as are the heaven and the earth?" The Messenger of Allah (ﷺ) replied in the affirmative. 'Umair remarked: "Great!" The Messenger of Allah (ﷺ) asked him what had urged him to say so. He replied: "Nothing, O Messenger of Allah! But hope that I might become one of the inhabitants of Jannah." The Messenger of Allah (ﷺ) said, "You will definitely be among them." 'Umair then took some dates out of his quiver and began to eat them, but after a short time he said: "If I survive till I eat my dates, it will mean a long life." So he threw away the dates which he had with him and then fought with the enemy till he was killed.[Muslim].
App reference: Book 12, Hadith 31
Arabic/English book reference: Book 12, Hadith 1315