From 6486590224d2ab3527518904f0d40c7a9dbcae36 Mon Sep 17 00:00:00 2001 From: Thomas Fransolet Date: Tue, 24 Aug 2021 20:20:43 +0200 Subject: [PATCH] fix bugs --- .../Section/section_detail_screen.dart | 2 +- .../configuration_detail_screen.dart | 4 ++-- lib/Screens/Devices/device_element.dart | 4 ++-- lib/Screens/login_screen.dart | 21 ++++++++++--------- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/lib/Screens/Configurations/Section/section_detail_screen.dart b/lib/Screens/Configurations/Section/section_detail_screen.dart index 89b45c9..27cf8f2 100644 --- a/lib/Screens/Configurations/Section/section_detail_screen.dart +++ b/lib/Screens/Configurations/Section/section_detail_screen.dart @@ -313,7 +313,7 @@ class _SectionDetailScreenState extends State { initialValue: sectionDTO.data, onChanged: (String data) { sectionDTO.data = data; - save(false, sectionDTO, appContext); + //save(false, sectionDTO, appContext); }, ); case SectionType.slider: diff --git a/lib/Screens/Configurations/configuration_detail_screen.dart b/lib/Screens/Configurations/configuration_detail_screen.dart index cd73014..7e57b5c 100644 --- a/lib/Screens/Configurations/configuration_detail_screen.dart +++ b/lib/Screens/Configurations/configuration_detail_screen.dart @@ -83,9 +83,9 @@ class _ConfigurationDetailScreenState extends State { Client clientAPI = appContext.getContext().clientAPI; ExportConfigurationDTO export = await clientAPI.configurationApi.configurationExport(configurationDTO.id); File test = await FileHelper().storeConfiguration(export); - showNotification(Colors.green, kWhite, "l'export de la configuration a réussi, le document se trouve là : " + test.path, context, 3000); + showNotification(Colors.green, kWhite, "L'export de la configuration a réussi, le document se trouve là : " + test.path, context, 3000); } catch(e) { - showNotification(kPrimaryColor, kWhite, "l'export de la configuration a échoué", context, null); + showNotification(kPrimaryColor, kWhite, "L'export de la configuration a échoué", context, null); } }, child: Padding( diff --git a/lib/Screens/Devices/device_element.dart b/lib/Screens/Devices/device_element.dart index cff8f35..755d096 100644 --- a/lib/Screens/Devices/device_element.dart +++ b/lib/Screens/Devices/device_element.dart @@ -78,8 +78,8 @@ class _DeviceElementState extends State { mainAxisAlignment: MainAxisAlignment.center, children: [ AutoSizeText( - deviceDTO.configuration, - style: new TextStyle(fontSize: 25), + deviceDTO.configuration != null ? deviceDTO.configuration : "Aucune configuration", + style: new TextStyle(fontSize: 20), maxLines: 1, ), ], diff --git a/lib/Screens/login_screen.dart b/lib/Screens/login_screen.dart index 7843ec5..4e5eb52 100644 --- a/lib/Screens/login_screen.dart +++ b/lib/Screens/login_screen.dart @@ -53,25 +53,26 @@ class _LoginScreenState extends State { if (isRememberMe) { Session updatedSession = new Session(rememberMe: isRememberMe, host: host, email: email, password: password); - print("REMBER ME TEST SESSIOn"); // update JSON FILE FileHelper().writeSession(updatedSession); } showNotification(Colors.lightGreen, kWhite, 'Connexion réussie', context, null); + ManagerAppContext managerAppContext = appContext.getContext(); // Set the appContext - if (appContext.getContext() == null) { - ManagerAppContext managerAppContext = new ManagerAppContext(); - // store user info locally - managerAppContext.email = email; - managerAppContext.token = token; - managerAppContext.clientAPI = clientAPI; - print(managerAppContext); - - appContext.setContext(managerAppContext); + if (managerAppContext == null) { + managerAppContext = new ManagerAppContext(); } + // store user info locally + managerAppContext.email = email; + managerAppContext.token = token; + managerAppContext.clientAPI = clientAPI; + print(managerAppContext); + + appContext.setContext(managerAppContext); + setState(() { isLoading = false; });