I am recreating an app I have previously made in Swift, and on one of my pages we call an API and based on the results, we present the user a dynamic number of textfields to
May be this can help you or other's as well.
createFieldsList(context) { thirdStepUserRegistration.value.forEach((key, value) { //// This line will loop all your data [ValueNotifier> thirdStepUserRegistration] if (!fieldsController.containsKey(key)) { fieldsController[key] = TextEditingController(); //// This one will create you a list of controllers that u need for your fiels [Map fieldsController] fieldsList.add( ////You will be creating a list of widget which is textfields [List fieldsList] Container( height: 40.0, margin: EdgeInsets.only(bottom: 10), width: MediaQuery.of(context).size.width - 100, child: PrimaryTextFormField( //This is my customize textfield you can create yours controller: fieldsController[key], keyboardType: TextInputType.text, textCapitalization: TextCapitalization.words, inputFormatters: textFormatter(), hintText: value, ), ) ); } }); } Column additionalDetails(BuildContext context) { createFieldsList(context); return Column( children: fieldsList ); }