configuracion - sugerencias - soporte
This commit is contained in:
@@ -89,30 +89,6 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.3.1"
|
||||
firebase_auth:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: firebase_auth
|
||||
sha256: "17b841e1b000c3441b8ffceca88f468e078d0443db9643e77541bdfb7a3fd16b"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.17.8"
|
||||
firebase_auth_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: firebase_auth_platform_interface
|
||||
sha256: f294ceef40409a36c819a14280ca864fe487b44033e5276443377c66cb448310
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "7.1.8"
|
||||
firebase_auth_web:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: firebase_auth_web
|
||||
sha256: "1f231da900fe7ff9f2974f8adcbdb3363c410c24725978afa5dc33e1e7e62e06"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "5.9.8"
|
||||
firebase_core:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -160,14 +136,6 @@ packages:
|
||||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.0"
|
||||
http_parser:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: http_parser
|
||||
sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.0.2"
|
||||
js:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -277,14 +245,6 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.6.1"
|
||||
typed_data:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: typed_data
|
||||
sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.3.2"
|
||||
vector_math:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
||||
@@ -13,7 +13,6 @@ dependencies:
|
||||
equatable: ^2.0.5
|
||||
|
||||
# Firebase
|
||||
firebase_auth: ^4.17.4
|
||||
cloud_firestore: ^4.15.4
|
||||
firebase_core: ^2.25.4
|
||||
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
library setting_repository;
|
||||
|
||||
export 'src/models/models.dart';
|
||||
export 'src/entities/entities.dart';
|
||||
export 'src/repositories/setting_repo.dart';
|
||||
export 'src/repositories/firebase_setting_repository.dart';
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
export '/src/entities/setting_entity.dart';
|
||||
@@ -0,0 +1,107 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
|
||||
class SettingEntity extends Equatable {
|
||||
final bool? tarifas;
|
||||
final bool? domicilios;
|
||||
final bool? google;
|
||||
final String? version;
|
||||
final String? horaNotificacion;
|
||||
final String? tituloSoporte;
|
||||
final String? parrafoSoporte;
|
||||
final String? numeroSoporte;
|
||||
final String? emailSoporte;
|
||||
final String? diasSoporte;
|
||||
final String? horasSoporte;
|
||||
final String? politicasPrivacidad;
|
||||
final String? politicasPrivacidadTitle;
|
||||
final String? politicasPrivacidadBody;
|
||||
final String? terminosCondiciones;
|
||||
final String? terminosCondicionesTitle;
|
||||
final String? terminosCondicionesBody;
|
||||
|
||||
const SettingEntity({
|
||||
required this.tarifas,
|
||||
required this.domicilios,
|
||||
required this.google,
|
||||
required this.version,
|
||||
required this.horaNotificacion,
|
||||
required this.tituloSoporte,
|
||||
required this.parrafoSoporte,
|
||||
required this.numeroSoporte,
|
||||
required this.emailSoporte,
|
||||
required this.diasSoporte,
|
||||
required this.horasSoporte,
|
||||
required this.politicasPrivacidad,
|
||||
required this.politicasPrivacidadTitle,
|
||||
required this.politicasPrivacidadBody,
|
||||
required this.terminosCondiciones,
|
||||
required this.terminosCondicionesTitle,
|
||||
required this.terminosCondicionesBody,
|
||||
});
|
||||
|
||||
static SettingEntity fromDocument(Map<String, dynamic> doc) {
|
||||
return SettingEntity(
|
||||
tarifas: doc['tarifas'] as bool?,
|
||||
domicilios: doc['domicilios'] as bool?,
|
||||
google: doc['google'] as bool?,
|
||||
version: doc['version'] as String?,
|
||||
horaNotificacion: doc['hora_notificacion'] as String?,
|
||||
tituloSoporte: doc['titulo_soporte'] as String?,
|
||||
parrafoSoporte: doc['parrafo_soporte'] as String?,
|
||||
numeroSoporte: doc['numero_soporte'] as String?,
|
||||
emailSoporte: doc['email_soporte'] as String?,
|
||||
diasSoporte: doc['dias_soporte'] as String?,
|
||||
horasSoporte: doc['horas_soporte'] as String?,
|
||||
politicasPrivacidad: doc['politicas_privacidad'] as String?,
|
||||
politicasPrivacidadTitle: doc['politicas_privacidad_title'] as String?,
|
||||
politicasPrivacidadBody: doc['politicas_privacidad_body'] as String?,
|
||||
terminosCondiciones: doc['terminos_condiciones'] as String?,
|
||||
terminosCondicionesTitle: doc['terminos_condiciones_title'] as String?,
|
||||
terminosCondicionesBody: doc['terminos_condiciones_body'] as String?,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
tarifas,
|
||||
domicilios,
|
||||
google,
|
||||
version,
|
||||
horaNotificacion,
|
||||
tituloSoporte,
|
||||
parrafoSoporte,
|
||||
numeroSoporte,
|
||||
emailSoporte,
|
||||
diasSoporte,
|
||||
horasSoporte,
|
||||
politicasPrivacidad,
|
||||
politicasPrivacidadTitle,
|
||||
politicasPrivacidadBody,
|
||||
terminosCondiciones,
|
||||
terminosCondicionesTitle,
|
||||
terminosCondicionesBody,
|
||||
];
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return '''SettingEntity {
|
||||
tarifas: $tarifas
|
||||
domicilios: $domicilios
|
||||
google: $google
|
||||
version: $version
|
||||
horaNotificacion: $horaNotificacion
|
||||
tituloSoporte: $tituloSoporte
|
||||
parrafoSoporte: $parrafoSoporte
|
||||
numeroSoporte: $numeroSoporte
|
||||
emailSoporte: $emailSoporte
|
||||
diasSoporte: $diasSoporte
|
||||
horasSoporte: $horasSoporte
|
||||
politicasPrivacidad: $politicasPrivacidad
|
||||
politicasPrivacidadTitle: $politicasPrivacidadTitle
|
||||
politicasPrivacidadBody: $politicasPrivacidadBody
|
||||
terminosCondiciones: $terminosCondiciones
|
||||
terminosCondicionesTitle: $terminosCondicionesTitle
|
||||
terminosCondicionesBody: $terminosCondicionesBody
|
||||
}''';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
|
||||
class SettingUi extends Equatable {
|
||||
final String cityName;
|
||||
final String coordsOfCity;
|
||||
final String stateOfCity;
|
||||
final String countryOfCity;
|
||||
|
||||
const SettingUi({
|
||||
required this.cityName,
|
||||
required this.coordsOfCity,
|
||||
required this.stateOfCity,
|
||||
required this.countryOfCity,
|
||||
});
|
||||
|
||||
@override
|
||||
List<Object?> get props =>
|
||||
[cityName, coordsOfCity, stateOfCity, countryOfCity];
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
import 'package:setting_repository/src/entities/entities.dart';
|
||||
import 'package:setting_repository/src/repositories/setting_repo.dart';
|
||||
import 'package:cloud_firestore/cloud_firestore.dart';
|
||||
|
||||
class FirebaseSettingRepository implements SettingRepository {
|
||||
final settingsCollection = FirebaseFirestore.instance.collection('settings');
|
||||
|
||||
@override
|
||||
Future<SettingEntity> getSettings() async {
|
||||
final DocumentSnapshot doc = await settingsCollection.doc('global').get();
|
||||
|
||||
return SettingEntity.fromDocument(doc.data() as Map<String, dynamic>);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
import 'package:setting_repository/src/entities/entities.dart';
|
||||
|
||||
abstract class SettingRepository {
|
||||
Future<SettingEntity> getSettings();
|
||||
}
|
||||
@@ -89,30 +89,6 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.3.1"
|
||||
firebase_auth:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: firebase_auth
|
||||
sha256: "17b841e1b000c3441b8ffceca88f468e078d0443db9643e77541bdfb7a3fd16b"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.17.8"
|
||||
firebase_auth_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: firebase_auth_platform_interface
|
||||
sha256: f294ceef40409a36c819a14280ca864fe487b44033e5276443377c66cb448310
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "7.1.8"
|
||||
firebase_auth_web:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: firebase_auth_web
|
||||
sha256: "1f231da900fe7ff9f2974f8adcbdb3363c410c24725978afa5dc33e1e7e62e06"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "5.9.8"
|
||||
firebase_core:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -160,14 +136,6 @@ packages:
|
||||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.0"
|
||||
http_parser:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: http_parser
|
||||
sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.0.2"
|
||||
js:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -277,14 +245,6 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.6.1"
|
||||
typed_data:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: typed_data
|
||||
sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.3.2"
|
||||
vector_math:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
name: setting_repository
|
||||
description: Dart package which manages the cities.
|
||||
description: Dart package which manages the settings.
|
||||
publish_to: "none"
|
||||
|
||||
version: 1.0.11+11
|
||||
@@ -13,7 +13,6 @@ dependencies:
|
||||
equatable: ^2.0.5
|
||||
|
||||
# Firebase
|
||||
firebase_auth: ^4.17.4
|
||||
cloud_firestore: ^4.15.4
|
||||
firebase_core: ^2.25.4
|
||||
|
||||
|
||||
Reference in New Issue
Block a user