jeudi 20 septembre 2018

Get Class Properties

I'm need a way to get the properties of a class, as I know this is with reflection, but I don't know how to apply it to Flutter.

This is my class:

class Login {

  final String name;
  final String email;
  final String token;
  final String refreshToken;
  final String createdAt;
  final String expiresAt;
  final bool isValid;

  Login({this.name, this.email, this.token, this.refreshToken, this.createdAt, this.expiresAt, this.isValid});

}

And I have to do something like getOwnProperties like is done in JS. I need to get an array of the properties that the class has.





Aucun commentaire:

Enregistrer un commentaire