import 'dart:convert';

import 'package:flutter/cupertino.dart';

class ModelPerson {
  final int id;
  final String password;
  final String name;
  final String photo;
  final String birth;
  final String inserted_date;
  final String type;
  final String email;

  ModelPerson(
      {this.id,
      @required this.password,
      @required this.name,
      @required this.photo,
      @required this.birth,
       this.inserted_date,
      @required this.type,
      @required this.email});

  factory ModelPerson.fromJson(Map<String, dynamic> json) {
    return ModelPerson(
        id: json['id'],
        password: json['password'],
        name: json['name'],
        photo: json['photo'],
        birth: json['birth'],
        inserted_date: json['inserted_date'],
        type: json['type'],
        email: json['email']);
  }
  String toJson() => json.encode({
        'id': this.id,
        'password': this.password,
        'name': this.name,
        'photo': this.photo,
        'birth': this.birth,
        'inserted_date': this.inserted_date,
        'type': this.type,
        'email': this.email
      });

  String toJsonNew() => json.encode({
    'password': this.password,
    'name': this.name,
    'photo': this.photo,
    'birth': this.birth,
    'type': this.type,
    'email': this.email
  });
}
