import 'package:flutter/cupertino.dart'; class UserModel { int? id; String? username; String? fullname; String? email; String? password; int? role_id; String? token; UserModel({ this.id, this.username, this.fullname, this.email, this.password, this.role_id, this.token, }); UserModel.fromJson(Map json) { id = json['id']; username = json['username']; fullname = json['fullname']; email = json['email']; password = json['password']; role_id = int.parse(json['role_id'].toString()); token = json['token'].toString(); } Map toJson() { return { 'id': id, 'username': username, 'email': email, 'password': password, 'role_id': role_id, 'token': token.toString(), }; } }