title: My string is initialized, but still shows up as null (flutter - dart)
body: <p>I hope you are doing well! </p>
  
  <p>I am working on a simple string tutorial with flutter and I ran into this issue regarding strings and the Text widget. I'm trying to create a string variable in my _MyHomePageState class, but my displayTxt is appearing null, even though I set a value to it. I used interpolation to see what value it contained and, sure enough, it was null. I'm semi-new to dart and flutter, so any and all help is appreciated. </p>
  
  <p>Have a great day!</p>
  
  <ul>
  <li>List item</li>
  </ul>
  
  <pre><code>import 'package:flutter/material.dart';
  
  void main() {
    runApp(MyApp());
  }
  
  class MyApp extends StatelessWidget {
    // This widget is the root of your application.
    @override
    Widget build(BuildContext context) {
      return MaterialApp(
        title: 'Flutter Demo',
        theme: ThemeData(
          primarySwatch: Colors.blue,
          visualDensity: VisualDensity.adaptivePlatformDensity,
        ),
        home: MyHomePage(title: 'Flutter Demo Home Page'),
      );
    }
  }
  
  class MyHomePage extends StatefulWidget {
    MyHomePage({Key key, this.title}) : super(key: key);
  
  
    final String title;
  
    @override
    _MyHomePageState createState() =&gt; _MyHomePageState();
  }
  
  class _MyHomePageState extends State&lt;MyHomePage&gt; {
  
    **String displayTxt = "Hello";**
  
    @override
    Widget build(BuildContext context) {
  
      return Scaffold(
        appBar: AppBar(
          title: Text(widget.title),
        ),
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: &lt;Widget&gt;[
              Row(
                children: &lt;Widget&gt;[
                  Text(
                    "Some text here",
                    style: TextStyle(
                      color: Colors.blue,
                      fontSize: 45,
                      fontWeight: FontWeight.bold,
                      fontStyle: FontStyle.italic,
                      letterSpacing: 2,
                      shadows: [
                        Shadow(
                          color: Colors.grey,
                          offset: Offset(-5,-5),
                        ),
                      ],
                      decoration: TextDecoration.underline,
                    ),
                  ),
                ],
              ),
  
              Row(
                mainAxisAlignment: MainAxisAlignment.center,
                children: &lt;Widget&gt;[
                  MaterialButton(
                    onPressed: () =&gt; {},
                    child: Row(
                      mainAxisSize: MainAxisSize.min,
                      children: &lt;Widget&gt;[
                        Icon(
                          Icons.airplanemode_active,
                          color: Colors.white,
                        ),
                        Text('press me'),
                      ],
                    ),
                    color: Colors.black,
                    textColor: Colors.white,
                    highlightColor: Colors.white10,
                    elevation: 10,
                  ),
                  Padding(
                    padding: const EdgeInsets.all(8.0),
                    **child: Text("${displayTxt}"),**
                  ),
                ],
              )
            ],
          ),
        ),
      );
    }
  }
  </code></pre>