title: Can I change the body of a widget using setState?
body: <p>My application has scaffold.</p>
  
  <p>But I want to change only the body of scaffold.</p>
  
  <p>Normally I use <code>setState()</code> to change the state, but in this case, How can I use <code>setState()</code> or I can do some other way??</p>
  
  <pre><code>import 'package:flutter/material.dart';
  
  void main() =&gt; runApp(MyApp());
  
  class MyApp extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      return MaterialApp(
        title: 'Flutter Demo',
        theme: ThemeData(
          primarySwatch: Colors.blue,
        ),
        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();
  }
  
    void onTapped() {
      print ("tapped");
      // I want to change only body of Scaffold like this
      // body: new Text("new body");
    };
  class _MyHomePageState extends State&lt;MyHomePage&gt; {
    @override
    Widget build(BuildContext context) {
  
      return Scaffold(
        appBar: AppBar(
          title: Text(widget.title),
        ),
        body: 
        GestureDetector(
          onTap: () =&gt; onTapped(),
          child:Center(
            child: Column(
              mainAxisAlignment: MainAxisAlignment.center,
              children: &lt;Widget&gt;[
                Text(
                  'You have pushed the button this many times:',
                ),
              ],
            ),
          ),
        ),
      );
    }
  }
  </code></pre>