flutterdartmobilecross-platformdeprecated

WillPopScope is deprecated in Flutter


'WillPopScope' is deprecated and shouldn't be used. Use PopScope instead. This feature was deprecated after v3.12.0-1.0.pre

WillPopScope(
  onWillPop: () async {
    // your logic        
    return false;
  },
)

Solution

  • Solved

    replace old widget from WillPopScope to PopScope new widget check below code

    /// NEW CODE
    PopScope(
      canPop: false,
      onPopInvoked : (didPop){
       // logic
      },
    )