I have a project that worked fine but after latest flutter core update it doesn't,I got:
E/flutter ( 4510): [ERROR:flutter/lib/ui/ui_dart_state.cc(166)] Unhandled Exception: 'package:flutter/src/widgets/navigator.dart': Failed assertion: line 3582 pos 12: '_history.any(_RouteEntry.isPresentPredicate)': Navigator has no active routes to replace. E/flutter ( 4510): #0
_AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:46:39) E/flutter ( 4510): #1 _AssertionError._throwNew (dart:core-patch/errors_patch.dart:36:5)
Future<void> _submit() async {
if (!_formKey.currentState.validate()) {
return;
}
_formKey.currentState.save();
final pref = await SharedPreferences.getInstance();
pref.setString('ip', _ip);
pref.setBool('isTablet', isTablet);
pref.setBool('setting1', isActivated);
// error on next part of the code
Navigator.of(context).pop();
Navigator.of(context).pushReplacementNamed('/');
Provider.of<Auth>(context, listen: false).logout();
}
thanks