title: why showDialog function is not opening the Dialog in parent?
body: <p>I want to open a dialog in a parent statefull widget and use a callback to trigger that function from child class statefull widget, but the function called in parent does not get executed from child, the function does get executed but the showDialog seems not to be used, I even tried to move the function responsible to open to dialog to the child class but showDialog does not work either.</p>
  <p>Here the code:</p>
  <p>shareDilog function in parent class:</p>
  <pre><code>  shareDialog(screenWidth, BuildContext cont) {
  
      return showDialog(
          context: cont,
          builder: (BuildContext cont) {
            print('inside inside');
            return Dialog(
              shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)),
              elevation: 0,
              child: StatefulBuilder(
                  builder: (BuildContext cont, StateSetter setState) {
                    return Container(
                      height: 680,
                      width: 650,
                      decoration: BoxDecoration(
                        color: Color(0xFF282828),
                      ),
                      child: ShareDialog(),
                    );
                  }),
            );
          },
          barrierDismissible: false
      );
  
    }
  </code></pre>
  <p>Where I pass this shareDialog function in parent to child:</p>
  <pre><code>Record(
        visibleColumns: visibleColumns,
        recordFullNameFieldName: recordFullNameFieldName,
        oneRecord: listRecordsFilter[index],
        screenWidth: screenWidth,
        openShareDialog: shareDialog,  // &lt;-------
        dashboardContext: context,    // &lt;--------
         )
  </code></pre>
  <p>Where the call gets executed in child:</p>
  <pre><code>final Function(double, BuildContext)? openShareDialog;  // the constructor parameter
  
              PopupMenuItem(
                onTap: () {
  
                  try {
  
                    widget.openShareDialog!(widget.screenWidth!, widget.dashboardContext!);  // &lt;---here the call back
                   // _showMyDialog();  // This is the test when I moved the function to the child
  
                  } catch(e) {
  
                    print(e);
  
                  }
  
                },
                child: ListTile(
                  leading: Icon(Icons.groups_sharp),
                  title: Text('Share'),
                ),
              ),
  </code></pre>