161 lines
5.3 KiB
Dart
161 lines
5.3 KiB
Dart
import 'package:hub/features/storage/index.dart';
|
|
|
|
abstract class DatabaseStorageKey implements IDatabaseStorage {
|
|
final String key;
|
|
const DatabaseStorageKey(this.key);
|
|
List<String> get values => [];
|
|
}
|
|
|
|
class ProfileStorageKey extends DatabaseStorageKey {
|
|
const ProfileStorageKey._(String key) : super(key);
|
|
|
|
static const String table = 'profileTable';
|
|
|
|
static const ProfileStorageKey userEmail = ProfileStorageKey._('fre_userEmail');
|
|
static const ProfileStorageKey devUUID = ProfileStorageKey._('fre_devUUID');
|
|
static const ProfileStorageKey userUUID = ProfileStorageKey._('fre_userUUID');
|
|
static const ProfileStorageKey userDevUUID = ProfileStorageKey._('fre_userDevUUID');
|
|
static const ProfileStorageKey status = ProfileStorageKey._('fre_status');
|
|
static const ProfileStorageKey userName = ProfileStorageKey._('fre_userName');
|
|
static const ProfileStorageKey clientUUID = ProfileStorageKey._('fre_cliUUID');
|
|
static const ProfileStorageKey ownerUUID = ProfileStorageKey._('fre_ownerUUID');
|
|
static const ProfileStorageKey clientName = ProfileStorageKey._('fre_cliName');
|
|
static const ProfileStorageKey ownerName = ProfileStorageKey._('fre_ownerName');
|
|
|
|
@override
|
|
List<String> get values => [
|
|
userEmail.key,
|
|
devUUID.key,
|
|
userUUID.key,
|
|
userDevUUID.key,
|
|
status.key,
|
|
userName.key,
|
|
clientUUID.key,
|
|
ownerUUID.key,
|
|
clientName.key,
|
|
ownerName.key,
|
|
];
|
|
}
|
|
|
|
class LocalsStorageKey extends DatabaseStorageKey {
|
|
const LocalsStorageKey._(String key) : super(key);
|
|
|
|
static const table = 'localTable';
|
|
|
|
static const LocalsStorageKey petAmount = LocalsStorageKey._('fre_petAmountRegister');
|
|
static const LocalsStorageKey whatsapp = LocalsStorageKey._('fre_whatsapp');
|
|
static const LocalsStorageKey provisional = LocalsStorageKey._('fre_provisional');
|
|
static const LocalsStorageKey pets = LocalsStorageKey._('fre_pets');
|
|
static const LocalsStorageKey local = LocalsStorageKey._('fre_local');
|
|
static const LocalsStorageKey notify = LocalsStorageKey._('fre_notify');
|
|
static const LocalsStorageKey fingerprint = LocalsStorageKey._('fre_fingerprint');
|
|
static const LocalsStorageKey access = LocalsStorageKey._('fre_access');
|
|
static const LocalsStorageKey panic = LocalsStorageKey._('fre_panic');
|
|
static const LocalsStorageKey person = LocalsStorageKey._('fre_person');
|
|
static const LocalsStorageKey requestOSNotification = LocalsStorageKey._('fre_requestOSnotification');
|
|
static const LocalsStorageKey isNewVersion = LocalsStorageKey._('fre_isNewVersion');
|
|
|
|
@override
|
|
List<String> get values => [
|
|
petAmount.key,
|
|
whatsapp.key,
|
|
provisional.key,
|
|
pets.key,
|
|
local.key,
|
|
notify.key,
|
|
fingerprint.key,
|
|
access.key,
|
|
panic.key,
|
|
person.key,
|
|
requestOSNotification.key,
|
|
isNewVersion.key,
|
|
];
|
|
}
|
|
|
|
// enum DatabaseStorageKey implements IDatabaseStorage {
|
|
// devUUID,
|
|
// userUUID,
|
|
// userDevUUID,
|
|
// status,
|
|
// userName,
|
|
// userEmail,
|
|
// clientUUID,
|
|
// ownerName,
|
|
// ownerUUID,
|
|
// clientName,
|
|
// petAmount,
|
|
// whatsapp,
|
|
// provisional,
|
|
// pets,
|
|
// local,
|
|
// notify,
|
|
// fingerprint,
|
|
// access,
|
|
// panic,
|
|
// person,
|
|
// requestOSNotification,
|
|
// isNewVersion,
|
|
// }
|
|
|
|
// extension ProfileStorageKeyExtension on DatabaseStorageKey {
|
|
// String get profile {
|
|
// switch (this) {
|
|
// case DatabaseStorageKey.userEmail:
|
|
// return 'fre_userEmail';
|
|
// case DatabaseStorageKey.devUUID:
|
|
// return 'fre_devUUID';
|
|
// case DatabaseStorageKey.userUUID:
|
|
// return 'fre_userUUID';
|
|
// case DatabaseStorageKey.userDevUUID:
|
|
// return 'fre_userDevUUID';
|
|
// case DatabaseStorageKey.status:
|
|
// return 'fre_status';
|
|
// case DatabaseStorageKey.userName:
|
|
// return 'fre_userName';
|
|
// case DatabaseStorageKey.clientUUID:
|
|
// return 'fre_cliUUID';
|
|
// case DatabaseStorageKey.ownerUUID:
|
|
// return 'fre_ownerUUID';
|
|
// case DatabaseStorageKey.clientName:
|
|
// return 'fre_cliName';
|
|
// case DatabaseStorageKey.ownerName:
|
|
// return 'fre_ownerName';
|
|
// default:
|
|
// return '';
|
|
// }
|
|
// }
|
|
// }
|
|
|
|
// extension LocalsStorageKeyExtension on DatabaseStorageKey {
|
|
// String get locals {
|
|
// switch (this) {
|
|
// case DatabaseStorageKey.petAmount:
|
|
// return 'fre_petAmountRegister';
|
|
// case DatabaseStorageKey.whatsapp:
|
|
// return 'fre_whatsapp';
|
|
// case DatabaseStorageKey.provisional:
|
|
// return 'fre_provisional';
|
|
// case DatabaseStorageKey.pets:
|
|
// return 'fre_pets';
|
|
// case DatabaseStorageKey.local:
|
|
// return 'fre_local';
|
|
// case DatabaseStorageKey.notify:
|
|
// return 'fre_notify';
|
|
// case DatabaseStorageKey.fingerprint:
|
|
// return 'fre_fingerprint';
|
|
// case DatabaseStorageKey.access:
|
|
// return 'fre_access';
|
|
// case DatabaseStorageKey.panic:
|
|
// return 'fre_panic';
|
|
// case DatabaseStorageKey.person:
|
|
// return 'fre_person';
|
|
// case DatabaseStorageKey.requestOSNotification:
|
|
// return 'fre_requestOSnotification';
|
|
// case DatabaseStorageKey.isNewVersion:
|
|
// return 'fre_isNewVersion';
|
|
// default:
|
|
// return '';
|
|
// }
|
|
// }
|
|
// }
|