Widget _buildStack() { child: Stack( key: _backdropKey, children: <Widget>[ widget.backLayer, widget.frontLayer, ], ); } contains an error. Replace it with: Widget _buildStack() { return Stack( key: _backdropKey, children: <Widget>[ widget.backLayer, widget.frontLayer, ], ); }