My problem was with PopScope. It was fixed when I added the "if (!didpop)" control.
PopScope( canPop: false, onPopInvokedWithResult: (didPop, result) { if (!didPop) goBack(); }, child: Scaffold(...