As we know in many programming languages like swift and etc. if you want to take array or list that has same value in all the index then we can do by one line of code. Repeat same value for specific time.
Ex. (In Swift language)
If In the Array I want to repeat 0 for 5 times then I can do by one line of code like below.
let fiveZeros = Array(repeating: "0", count: 5)
print(fiveZeros)
// Prints "["0", "0", "0", "0", "0"]"
So I'm looking same for flutter. is there any specific built-in function that will help us to achieve same features?
Yes in the Flutter you can use "filled factory of List" That will help us to achieve same features.
Ex.
final fiveZeros = List.filled(5, 0);print(fiveZeros); //-> [0, 0, 0, 0, 0]
If you have any query or question then please give your feedback as comment.