title: Why does a change in state of a child bottom sheet trigger a rebuild of parent widget?
body: <p>I have a Scaffold screen (ListsScreen). 
  Which has a Button(AddNewListButton) that opens up a Modal Bottom Sheet (ListScreenBottomSheetWidget). 
  Bottom Sheet has TextField (ListTitleInputTextFieldWidget). </p>
  
  <p>When i tap the TextField to open the keyboard, the parent screen rebuilds itself, due to which ofcourse all its child widgets are rebuilt as well. </p>
  
  <p>Why is this happening? I was under the impression that state changes only rebuild themselves or their children, not their parents. And i also added const constructors almost everywhere to avoid rebuilds but this is still happening. </p>
  
  <p>The Parent ListsScreen:</p>
  
  <pre><code>class ListsScreen extends StatelessWidget {
    const ListsScreen();
    static const routeName = '/lists-screen';
  
    @override
    Widget build(BuildContext context) {
      final user = Provider.of&lt;AuthProvider&gt;(context, listen: false).getUser;
      print('stateless rebuilding');
      return Scaffold(
        appBar: AppBar(
          centerTitle: false,
          title: Text(
            '${user['name']}\'s Lists',
            style: TextStyle(
              color: Theme.of(context).primaryColorLight,
            ),
          ),
          actions: &lt;Widget&gt;[
            const SignOutButton(),
          ],
        ),
        body: Center(
          child: Padding(
            padding: const EdgeInsets.all(20.0),
            child: Column(
              children: &lt;Widget&gt;[
                SizeConfig.smallDevice
                    ? const SizedBox(
                        height: 30,
                      )
                    : const SizedBox(
                        height: 40,
                      ),
                SizeConfig.smallDevice
                    ? Text(
                        'Welcome to TODOS',
                        textAlign: TextAlign.center,
                        style: TextStyle(
                          fontSize: 20,
                          color: Colors.grey[700],
                        ),
                      )
                    : Text(
                        'Welcome to TODOS',
                        textAlign: TextAlign.center,
                        style: TextStyle(
                          fontSize: 25,
                          color: Colors.grey[700],
                        ),
                      ),
                SizeConfig.smallDevice
                    ? const SizedBox(
                        height: 30,
                      )
                    : const SizedBox(
                        height: 40,
                      ),
                const AddNewListButton(),
                SizeConfig.smallDevice
                    ? const SizedBox(
                        height: 30,
                      )
                    : const SizedBox(
                        height: 40,
                      ),
                const UserListsListViewWidget(),
              ],
            ),
          ),
        ),
      );
    }
  }
  
  class SignOutButton extends StatelessWidget {
    const SignOutButton();
  
    Future&lt;void&gt; _submitRequest(BuildContext context) async {
      _showLoadingAlert(context);
  
      try {
        await Provider.of&lt;AuthProvider&gt;(context, listen: false)
            .submitLogOutRequest();
        Navigator.of(context).pop();
        Navigator.of(context).pushReplacementNamed(LoginScreen.routeName);
      } on HttpExceptions catch (error) {
        Navigator.of(context).pop();
        _showErrorDialogue(error.getErrorList, context);
      }
    }
  
    void _showErrorDialogue(List&lt;dynamic&gt; errorMessages, BuildContext context) {
      showDialog(
        context: context,
        builder: (ctx) =&gt; Dialog(
          shape: RoundedRectangleBorder(
            borderRadius: BorderRadius.circular(20.0),
          ),
          child: ErrorListWidget(errorMessages: errorMessages),
        ),
      );
    }
  
    void _showLoadingAlert(BuildContext context) {
      showDialog(
        context: context,
        builder: (ctx) =&gt; const LoadingWidget(),
      );
    }
  
    @override
    Widget build(BuildContext context) {
      return FlatButton(
        onPressed: () =&gt; _submitRequest(context),
        child: Row(
          children: &lt;Widget&gt;[
            Text(
              'Sign Out',
              style: TextStyle(
                color: Theme.of(context).primaryColorLight,
              ),
            ),
            Icon(
              Icons.exit_to_app,
              color: Theme.of(context).primaryColorLight,
            ),
          ],
        ),
      );
    }
  }
  
  class AddNewListButton extends StatelessWidget {
    const AddNewListButton();
  
    void _modalBottomSheetMenu(BuildContext context) {
      showModalBottomSheet(
        context: context,
        backgroundColor: Colors.transparent,
        isScrollControlled: true,
        builder: (builder) {
          return const ListScreenBottomSheetWidget();
        },
      );
    }
  
    @override
    Widget build(BuildContext context) {
      return RaisedButton(
        shape: RoundedRectangleBorder(
          borderRadius: BorderRadius.circular(5),
        ),
        elevation: 10,
        color: Theme.of(context).primaryColor,
        onPressed: () =&gt; _modalBottomSheetMenu(context),
        child: Text(
          '+ Add List',
          style: TextStyle(
            color: Colors.white,
            fontSize: SizeConfig.smallDevice ? 10 : 15,
          ),
        ),
      );
    }
  }
  </code></pre>
  
  <p>The Modal Bottom Sheet:</p>
  
  <pre><code>import 'package:flutter/material.dart';
  import 'package:todo_spicotech/helpers/size_config.dart';
  
  class ListScreenBottomSheetWidget extends StatelessWidget {
    const ListScreenBottomSheetWidget();
    @override
    Widget build(BuildContext context) {
      return GestureDetector(
        onTap: () {
          FocusScopeNode currentFocus = FocusScope.of(context);
          if (!currentFocus.hasPrimaryFocus) {
            currentFocus.unfocus();
          }
          currentFocus.unfocus();
        },
        child: Container(
          margin: const EdgeInsets.all(20.0),
          padding: EdgeInsets.only(
            bottom: MediaQuery.of(context).viewInsets.bottom,
          ),
          child: Material(
            borderRadius: BorderRadius.all(Radius.circular(15)),
            elevation: 10,
            child: Padding(
              padding: const EdgeInsets.all(20.0),
              child: Column(
                mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                mainAxisSize: MainAxisSize.min,
                children: &lt;Widget&gt;[
  
                  SizeConfig.smallDevice
                      ? Text(
                          'Create a new List',
                          textAlign: TextAlign.center,
                          style: TextStyle(
                            fontSize: 20,
                            color: Colors.grey[700],
                          ),
                        )
                      : Text(
                          'Create a new List',
                          textAlign: TextAlign.center,
                          style: TextStyle(
                            fontSize: 25,
                            color: Colors.grey[700],
                          ),
                        ),
                  SizeConfig.smallDevice
                      ? const SizedBox(
                    height: 20,
                  )
                      : const SizedBox(
                    height: 30,
                  ),
                  const ListTitleInputTextFieldWidget(),
                  SizeConfig.smallDevice
                      ? const SizedBox(
                    height: 20,
                  )
                      : const SizedBox(
                    height: 30,
                  ),
                  Row(
                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                    children: &lt;Widget&gt;[
                      InkWell(
                        borderRadius: BorderRadius.circular(5),
                        onTap: () {
                          Navigator.of(context).pop();
                        },
                        child: Ink(
                          padding: EdgeInsets.all(10),
                          child: const Text('CANCEL'),
                        ),
                      ),
                      RaisedButton(
                        shape: RoundedRectangleBorder(
                          borderRadius: BorderRadius.circular(5),
                        ),
                        elevation: 10,
                        color: Theme.of(context).primaryColor,
                        onPressed: () {},
                        child: Text(
                          'Create',
                          style: TextStyle(
                            color: Colors.white,
                            fontSize: SizeConfig.smallDevice ? 10 : 15,
                          ),
                        ),
                      ),
                    ],
                  ),
                ],
              ),
            ),
          ),
        ),
      );
    }
  }
  
  class ListTitleInputTextFieldWidget extends StatefulWidget {
    const ListTitleInputTextFieldWidget();
    @override
    _ListTitleInputTextFieldWidgetState createState() =&gt; _ListTitleInputTextFieldWidgetState();
  }
  
  class _ListTitleInputTextFieldWidgetState extends State&lt;ListTitleInputTextFieldWidget&gt; {
    @override
    Widget build(BuildContext context) {
      return TextFormField(
        decoration: const InputDecoration(
          enabledBorder: OutlineInputBorder(
            borderSide: BorderSide(
              color: Colors.lightBlue,
            ),
          ),
          focusedBorder: OutlineInputBorder(
            borderSide: BorderSide(
              color: Colors.lightBlue,
            ),
          ),
          labelText: 'List Title',
          contentPadding: EdgeInsets.all(10),
        ),
      );
    }
  }
  
  </code></pre>