This commit is contained in:
Ivan Murashov
2018-03-10 02:41:53 +03:00
parent bd1e0ec17f
commit 60f506a08d
6 changed files with 31 additions and 35 deletions

View File

@@ -64,28 +64,33 @@ class SqliteHelper {
}
/// Создается запись в таблице, содержащая данные, которые не зависят от сессии.
Future createAppInfo(int currency) async {
Future createAppInfo(int currency, String locale) async {
List<Map> appInfo = await db.query(tableSettings);
if (appInfo.length > 0) {
return null;
} else {
return db.insert(tableSettings, {
columnCurrency: currency
columnCurrency: currency,
columnLocale: locale
});
}
}
Future<Map> getSettings(bool withSession) async {
Map results = new Map();
Map settings = await selectAll(tableSettings);
results.addAll(settings);
if (withSession) {
Map session = await selectAll(tableSession);
if (settings != null && session != null) {
settings.addAll(session);
results.addAll(session);
}
}
return settings;
return results;
}
Future<String> getToken() async {