diff --git a/lib/Screens/Home/configurations_list.dart b/lib/Screens/Home/configurations_list.dart index 8604ab9..0bb0489 100644 --- a/lib/Screens/Home/configurations_list.dart +++ b/lib/Screens/Home/configurations_list.dart @@ -78,13 +78,7 @@ class _ConfigurationsListState extends State { builder: (context) => VisitPage(configurationId: configurations[index].id!, isAlreadyAllowed: visitAppContext.isScanBeaconAlreadyAllowed), )); - /*Navigator.push( - context, - MaterialPageRoute( - builder: (context) => VisitPage(configurationId: configurations[index].id!) - ), - );*/ - /**/ + } } else { if (configurations[index].isOffline!) { @@ -97,21 +91,25 @@ class _ConfigurationsListState extends State { ); } else { // Online mode - // Update context - visitAppContext.configuration = configurations[index]; - visitAppContext.sectionIds = configurations[index].sectionIds; + if(!configurations[index].languages!.contains(visitAppContext.language)) + { + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text(TranslationHelper.getFromLocale( + "languageNotSupported", appContext.getContext())), + backgroundColor: kBlue2), + ); + } else { + visitAppContext.configuration = configurations[index]; + visitAppContext.sectionIds = configurations[index].sectionIds; - /*Navigator.push( - context, - MaterialPageRoute( - builder: (context) => VisitPage(configurationId: configurations[index].id!) - ), - );*/ + appContext.setContext(visitAppContext); - Navigator.of(context).pushReplacement(MaterialPageRoute( - builder: (context) => - VisitPage(configurationId: configurations[index].id!, isAlreadyAllowed: visitAppContext.isScanBeaconAlreadyAllowed), - )); + Navigator.of(context).pushReplacement(MaterialPageRoute( + builder: (context) => + VisitPage(configurationId: configurations[index].id!, isAlreadyAllowed: visitAppContext.isScanBeaconAlreadyAllowed), + )); + } } } },