Added option to show client name and processing time on logs

This commit is contained in:
Juan Gilsanz Polo 2022-10-27 22:57:59 +02:00
parent fb74be3e69
commit fff50604a6
6 changed files with 146 additions and 9 deletions

View file

@ -35,6 +35,26 @@ class GeneralSettings extends StatelessWidget {
}
}
Future updateShowNameTimeLogs(bool newStatus) async {
final result = await appConfigProvider.setShowNameTimeLogs(newStatus);
if (result == true) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(AppLocalizations.of(context)!.settingsUpdatedSuccessfully),
backgroundColor: Colors.green,
)
);
}
else {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(AppLocalizations.of(context)!.cannotUpdateSettings),
backgroundColor: Colors.red,
)
);
}
}
return Scaffold(
appBar: AppBar(
title: Text(AppLocalizations.of(context)!.generalSettings) ,
@ -58,6 +78,23 @@ class GeneralSettings extends StatelessWidget {
right: 10
)
),
CustomListTile(
icon: Icons.more,
title: AppLocalizations.of(context)!.nameTimeLogs,
subtitle: AppLocalizations.of(context)!.nameTimeLogsDescription,
trailing: Switch(
value: appConfigProvider.showNameTimeLogs,
onChanged: updateShowNameTimeLogs,
activeColor: Theme.of(context).primaryColor,
),
onTap: () => updateShowNameTimeLogs(!appConfigProvider.showNameTimeLogs),
padding: const EdgeInsets.only(
top: 10,
bottom: 10,
left: 20,
right: 10
)
),
],
),
);