79556646

Date: 2025-04-05 06:54:42
Score: 2
Natty:
Report link

Did this resolve your issue?

Wrap this code:

Navigator.push(
  context,
  MaterialPageRoute(
    builder: (context) => AddVehiclePage(
      edit: true,
      data: vehicle,
    ),
  ),
).then((onValue) {
  getvalue();
});

with WidgetsBinding.instance.addPostFrameCallback((_) { // Your Navigator here });. Moreover, since you're handling the BuildContext class. Therefore, you need to ensure that the current BuildContext class is currently mounted in the widget tree using context.mounted.

It should be something like this:

WidgetsBinding.instance.addPostFrameCallback((_) {
  if (context.mounted) {
    Navigator.push(
      context,
      MaterialPageRoute(
        builder: (context) => AddVehiclePage(
          edit: true,
          data: vehicle,
        ),
      ),
    ).then((onValue) {
      getvalue();
    });
  }
});
Reasons:
  • RegEx Blacklisted phrase (1.5): resolve your issue?
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Starts with a question (0.5): Did this
  • Low reputation (0.5):
Posted by: DevQt