skip to Main Content

enter image description hereenter image description here

I’m Trying to capture onChanged property value which is comming from my TextField and use it inside my onPressed textButton but it’s not working. I’ve read most of the related issues in stack overflow but none of it actually helping in the problem. Do you have any better suggestion that I should do.

2

Answers


  1. You have not initialized newTaskTile before accessing it.
    So, at line 12 instead of:

    String newTaskTile;
    

    use:

    String newTaskTile='';
    
    Login or Signup to reply.
  2. You can use

        late String? newTaskTile;
    

    and assign a value on init

      @override
      void initState() {
        super.initState();
        newTaskTile = 'some value';
      }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search