getUserData method

Future<Map<String, dynamic>> getUserData({
  1. String fields = "name,email,picture.width(200)",
})

retrive the user information using the GraphAPI

fields string of fields like birthday,email,hometown

The facebook SDK will return a JSON like

{
 "name": "Open Graph Test User",
 "email": "[email protected]",
 "picture": {
   "data": {
     "height": 126,
     "url": "https://scontent.fuio21-1.fna.fbcdn.net/v/t1.30497-1/s200x200/8462.jpg",
     "width": 200
   }
 },
 "id": "136742241592917"
}

The above JSON could be change, it depends of your fields argument.

Implementation

Future<Map<String, dynamic>> getUserData({
  String fields = "name,email,picture.width(200)",
}) async {
  final result = await _authPlatform.getUserData(fields: fields);
  return Map<String, dynamic>.from(result);
}