Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fullname property to retrieve user's fullname. #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/flutter_insta.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import 'package:http/http.dart' as http; // import http package for API calls

class FlutterInsta {
String url = "https://www.instagram.com/";
String? _followers, _following, _website, _bio, _imgurl, _username;
String? _followers, _following, _website, _bio, _imgurl, _username, _fullname;
// List of images from user feed
List<String>? _feedImagesUrl;

Expand All @@ -30,6 +30,7 @@ class FlutterInsta {
var graphql = data['graphql'];
var user = graphql['user'];
var biography = user['biography'];
var full_name = user['full_name'];
_bio = biography;
var myfollowers = user['edge_followed_by'];
var myfollowing = user['edge_follow'];
Expand All @@ -41,6 +42,7 @@ class FlutterInsta {
.map<String>((image) => image['node']['display_url'] as String)
.toList();
this._username = username;
this._fullname = full_name;
}

String? get followers => _followers; // number of followers of the user
Expand All @@ -55,6 +57,8 @@ class FlutterInsta {

get imgurl => _imgurl; // Profile picture URL

get fullname => _fullname; // Instagram bio of the user

List<String>? get feedImagesUrl =>
_feedImagesUrl; // List of URLs of feed images
}