0

In Flutter TextField i have some text already present in it. Which Looks like this

#include<stdio.h>

int main()

{

  //Text to be entered at this location

  return 0;

}

Now if i insert below string at the selected cursor location

for(int i=0;i<5;i++)

{

}

After Inserting text In Textfield I get the output as below

#include<stdio.h>

int main()

{

 for(int i=0;i<5;i++)

{

}

  return 0;

}

How Do i maintain the indentation of the for loop,i.e,how do i get those curly braces just below for loop and not at the start of next line?

Thanks and Regards,

Narayan

  • Can you plese elaborate more? I think, you want the for loop part to be generated dynamically, while running the app? And the #include and else part should not be affected and generated only once? – Shreyansh Sharma May 04 '21 at 15:22
  • It is often time taking to write for loop,so what I'm doing is I am having one widget which takes the conditions of the for loop as input and then based on inputs ,I create string which is equivalent to the for loop ,So now I want to append that for loop string inside main function – narayan rathod May 04 '21 at 15:25

0 Answers0