123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- import 'package:firebase_helpers/firebase_helpers.dart';
-
- //En esta Area definimos todas las variables y parametros utilizadas en las
- //funciones de los otros files.
-
- //Son las mismas variables usadas para enviar al servidor y recibir de vuelta
- // a la aplicacion.
-
- class EventModel extends DatabaseItem{
- final String id;
- final String title;
- final String description;
- final DateTime eventDate;
- final String name;
- final String number;
- final String reason;
- final DateTime eventTime;
-
-
- EventModel({this.id,this.title, this.description, this.eventDate, this.name, this.number, this.reason, this.eventTime}):super(id);
-
- factory EventModel.fromMap(Map data) {
- return EventModel(
- title: data['title'],
- description: data['description'],
- name: data['name'],
- number: data['number'],
- reason: data['reason'],
- eventDate: data['event_date'],
- eventTime: data['event_time'],
- );
- }
-
- factory EventModel.fromDS(String id, Map<String,dynamic> data) {
- return EventModel(
- id: id,
- title: data['title'],
- description: data['description'],
- number: data['number'],
- reason: data['reason'],
- eventDate: data['event_date'].toDate(),
- eventTime: data['event_time'].toTime(),
- );
- }
-
- final Map<DateTime, List> _holidays = {
- DateTime(2020, 11, 6): ['No Hay Citas'],
- DateTime(2020, 11, 3): ['Dia Elecciones'],
- DateTime(2020, 12, 25): ['Chrismas'],
- DateTime(2020, 12, 31): ['Despedida del anyo nuevo'],
- };
-
-
- Map<String,dynamic> toMap() {
- return {
- "title":title,
- "description": description,
- "event_date":eventDate,
- "id":id,
- "name":name,
- "number":number,
- "reason":reason,
- "event_time":eventTime,
- };
- }
- }
|