Bug type 'Null' is not a subtype of type 'City' in type cast

  1. I try to access in my second screen but I get this error
    type ‘Null’ is not a subtype of type ‘City’ in type cast
    the code is : final City city = ModalRoute.of(context)?.settings.arguments as City;