flutter
flutter

Reputation: 6766

What widget do you use to return a number of type int?

I need to return an int from the build() method in a StatelessWidget class. build() method obviously returns a Widget. How can I convert my int to a Widget?

Upvotes: 0

Views: 256

Answers (1)

Rémi Rousselet
Rémi Rousselet

Reputation: 276911

A Text will do

Text(42.toString())

Upvotes: 1

Related Questions