This commit is contained in:
Thomas Fransolet 2021-08-24 20:20:43 +02:00
parent 2674233113
commit 6486590224
4 changed files with 16 additions and 15 deletions

View File

@ -313,7 +313,7 @@ class _SectionDetailScreenState extends State<SectionDetailScreen> {
initialValue: sectionDTO.data, initialValue: sectionDTO.data,
onChanged: (String data) { onChanged: (String data) {
sectionDTO.data = data; sectionDTO.data = data;
save(false, sectionDTO, appContext); //save(false, sectionDTO, appContext);
}, },
); );
case SectionType.slider: case SectionType.slider:

View File

@ -83,9 +83,9 @@ class _ConfigurationDetailScreenState extends State<ConfigurationDetailScreen> {
Client clientAPI = appContext.getContext().clientAPI; Client clientAPI = appContext.getContext().clientAPI;
ExportConfigurationDTO export = await clientAPI.configurationApi.configurationExport(configurationDTO.id); ExportConfigurationDTO export = await clientAPI.configurationApi.configurationExport(configurationDTO.id);
File test = await FileHelper().storeConfiguration(export); 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) { } 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( child: Padding(

View File

@ -78,8 +78,8 @@ class _DeviceElementState extends State<DeviceElement> {
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
AutoSizeText( AutoSizeText(
deviceDTO.configuration, deviceDTO.configuration != null ? deviceDTO.configuration : "Aucune configuration",
style: new TextStyle(fontSize: 25), style: new TextStyle(fontSize: 20),
maxLines: 1, maxLines: 1,
), ),
], ],

View File

@ -53,25 +53,26 @@ class _LoginScreenState extends State<LoginScreen> {
if (isRememberMe) { if (isRememberMe) {
Session updatedSession = new Session(rememberMe: isRememberMe, host: host, email: email, password: password); Session updatedSession = new Session(rememberMe: isRememberMe, host: host, email: email, password: password);
print("REMBER ME TEST SESSIOn");
// update JSON FILE // update JSON FILE
FileHelper().writeSession(updatedSession); FileHelper().writeSession(updatedSession);
} }
showNotification(Colors.lightGreen, kWhite, 'Connexion réussie', context, null); showNotification(Colors.lightGreen, kWhite, 'Connexion réussie', context, null);
ManagerAppContext managerAppContext = appContext.getContext();
// Set the appContext // Set the appContext
if (appContext.getContext() == null) { if (managerAppContext == null) {
ManagerAppContext managerAppContext = new ManagerAppContext(); managerAppContext = new ManagerAppContext();
// store user info locally
managerAppContext.email = email;
managerAppContext.token = token;
managerAppContext.clientAPI = clientAPI;
print(managerAppContext);
appContext.setContext(managerAppContext);
} }
// store user info locally
managerAppContext.email = email;
managerAppContext.token = token;
managerAppContext.clientAPI = clientAPI;
print(managerAppContext);
appContext.setContext(managerAppContext);
setState(() { setState(() {
isLoading = false; isLoading = false;
}); });