However, if we assume the sentence is "The children went to sleep after the party," then dreaming is a gerund. It's acting as the object of the preposition "after".
Here's the breakdown:
* Gerund: A verb form ending in "-ing" that functions as a noun.
* Infinitive: The base form of a verb, often preceded by "to."
* Prepositional phrase: A group of words that starts with a preposition and ends with a noun or pronoun.
In this sentence, "dreaming" is a noun, so it's a gerund. It's not an infinitive because it's not preceded by "to." It's the object of the preposition "after."