Skip to content
Snippets Groups Projects
data_model.dart 1010 B
Newer Older
import 'package:shared_preferences/shared_preferences.dart';
  int id;
  String urn;
  String label;
  String type;
  String description;
  String status;
  Event(
    this.id,
    this.urn,
    this.label,
    this.type,
    this.description,
    this.status
  );

  factory Event.fromJson(Map<String, dynamic> parsedJson){
    return Event( parsedJson['id'] as int,
        parsedJson['urn'] as String,
        parsedJson['label'] as String,
        parsedJson['type'] as String,
        parsedJson['description'] as String,
        parsedJson['status'] as String );
  }

  @override
  String toString(){
    return '{ ${this.id}, ${this.urn}, ${this.label}, ${this.type}, ${this.description}, ${this.status} }';
  }
}

abstract class EventStoreBase{
  List<Event> store = [];

  //void setStore(List<Event> st){
  //  store = st;
  //}
  //void reset(){
  //  store = [];
  //}
  String name;
  int id;

  EventType({
    required this.name,
    required this.id
});