formatted all files.

This commit is contained in:
Faris Armoush
2025-06-12 15:33:32 +03:00
parent 29959f567e
commit 04250ebc98
474 changed files with 5425 additions and 4338 deletions

View File

@ -2,7 +2,7 @@ import 'dart:convert';
String decodeBase64(String str) {
//'-', '+' 62nd char of encoding, '_', '/' 63rd char of encoding
String output = str.replaceAll('-', '+').replaceAll('_', '/');
var output = str.replaceAll('-', '+').replaceAll('_', '/');
switch (output.length % 4) {
// Pad with trailing '='
case 0: // No pad chars in this case

View File

@ -1,52 +1,52 @@
import 'package:shared_preferences/shared_preferences.dart';
class SharedPreferencesHelper {
static saveStringToSP(String key, String value) async {
static Future<void> saveStringToSP(String key, String value) async {
final prefs = await SharedPreferences.getInstance();
await prefs.setString(key, value);
}
static saveBoolToSP(String key, bool value) async {
static Future<void> saveBoolToSP(String key, bool value) async {
final prefs = await SharedPreferences.getInstance();
await prefs.setBool(key, value);
}
static saveIntToSP(String key, int value) async {
static Future<void> saveIntToSP(String key, int value) async {
final prefs = await SharedPreferences.getInstance();
await prefs.setInt(key, value);
}
static saveDoubleToSP(String key, double value) async {
static Future<void> saveDoubleToSP(String key, double value) async {
final prefs = await SharedPreferences.getInstance();
await prefs.setDouble(key, value);
}
static saveStringListToSP(String key, List<String> value) async {
static Future<void> saveStringListToSP(String key, List<String> value) async {
final prefs = await SharedPreferences.getInstance();
await prefs.setStringList(key, value);
}
static Future<String> readStringFromSP(String key) async {
final prefs = await SharedPreferences.getInstance();
String value = prefs.getString(key) ?? '';
final value = prefs.getString(key) ?? '';
return value;
}
static Future<bool?> readBoolFromSP(String key) async {
final prefs = await SharedPreferences.getInstance();
bool? value = prefs.getBool(key);
final value = prefs.getBool(key);
return value;
}
static Future<int> readIntFromSP(String key) async {
final prefs = await SharedPreferences.getInstance();
int value = prefs.getInt(key) ?? 0;
final value = prefs.getInt(key) ?? 0;
return value;
}
static Future<List<String>> readStringListFromSP(String key) async {
final prefs = await SharedPreferences.getInstance();
List<String>? value = prefs.getStringList(key) ?? [];
final value = prefs.getStringList(key) ?? [];
return value;
}