title: The non-nullable local variable 'title' must be assigned before it can be used. Flutter error
body: <p>I want to take user input from the <code>textfield widget</code> and assign in <code>title</code> variable as in this code</p>
  <pre><code>import 'package:flutter/material.dart';
  
  class AddTaskScreen extends StatelessWidget {
    final Function callBack; // function
  
    AddTaskScreen({required this.callBack});
  
    @override
    Widget build(BuildContext context) {
      String title; // declaring the variable
      return Container(
        height: 350,
        color: Color(0xff757575),
        child: Container(
          padding: EdgeInsets.all(20),
          decoration: BoxDecoration(
            color: Colors.white,
            borderRadius: BorderRadius.only(
              topRight: Radius.circular(20),
              topLeft: Radius.circular(20),
            ),
          ),
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.stretch,
            children: [
              Text(
                'Add Task',
                textAlign: TextAlign.center,
                style: TextStyle(
                  color: Colors.lightBlueAccent,
                  fontSize: 24,
                ),
              ),
              SizedBox(
                height: 20,
              ),
              TextField(
                textAlign: TextAlign.center,
                autofocus: false,
                style: TextStyle(
                  color: Colors.black,
                  fontSize: 15,
                ),
                onChanged: (value) {
                  title = value; // taking the user input
                },
                decoration: InputDecoration(
                  focusColor: Colors.lightBlueAccent,
                  hintText: 'Type a Task',
                  hintStyle: TextStyle(
                    color: Colors.grey,
                    fontSize: 12,
                  ),
                ),
              ),
              SizedBox(
                height: 20,
              ),
              TextButton(
                onPressed: () {
                  callBack(title); // error
                },
                style: TextButton.styleFrom(
                  backgroundColor: Colors.lightBlueAccent,
                ),
                child: Text(
                  'Add',
                  style: TextStyle(
                    color: Colors.white,
                    fontSize: 18,
                  ),
                ),
              ),
            ],
          ),
        ),
      );
    }
  }
  </code></pre>
  <p>as you can see there is a function <code>callBack</code> variable. it has the <code>String</code> parameter when I pass <code>title</code> in this function it gives me a warning.
  here is the code for the callBack when will send this information.</p>
  <pre><code>import 'package:flutter/material.dart';
  import 'package:todoey/models/Task.dart';
  import 'package:todoey/screens/add_task_screen.dart';
  import 'package:todoey/screens/bottom_section.dart';
  import 'package:todoey/screens/top_section.dart';
  
  class TasksScreen extends StatefulWidget {
    @override
    State&lt;TasksScreen&gt; createState() =&gt; _TasksScreenState();
  }
  
  class _TasksScreenState extends State&lt;TasksScreen&gt; {
    List&lt;Task&gt; tasks = [];
  
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        floatingActionButton: FloatingActionButton(
          onPressed: () {
            showModalBottomSheet(
              context: context,
              builder: (context) =&gt; SingleChildScrollView(
                child: Container(
                  padding: EdgeInsets.only(
                      bottom: MediaQuery.of(context).viewInsets.bottom),
                  child: AddTaskScreen(
                    callBack: (String taskTitle) {
                      setState(() {
                        print(taskTitle);
                        tasks.add(
                          Task(
                            name: taskTitle,
                          ),
                        );
                      });
                      Navigator.pop(context);
                    },
                  ).build(context),
                ),
              ),
            );
          },
          child: Icon(
            Icons.add,
            color: Colors.white,
            size: 35,
          ),
          elevation: 5,
          backgroundColor: Colors.lightBlueAccent,
        ),
        backgroundColor: Colors.lightBlueAccent,
        body: SafeArea(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.start,
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              TopSection(),
              SizedBox(
                height: 30,
              ),
              BottomSection(tasks: tasks),
            ],
          ),
        ),
      );
    }
  }
  </code></pre>
  <p>for the main class, here is the code.</p>
  <pre><code>import 'package:flutter/material.dart';
  import 'package:todoey/screens/task_screen.dart';
  
  void main() {
    runApp(MyApp());
  }
  
  class MyApp extends StatelessWidget {
    const MyApp({Key? key}) : super(key: key);
  
    @override
    Widget build(BuildContext context) {
      return MaterialApp(
        debugShowCheckedModeBanner: false,
        home: TasksScreen(),
      );
    }
  }
  </code></pre>