flutter_instagram_api 1.0.0 copy "flutter_instagram_api: ^1.0.0" to clipboard
flutter_instagram_api: ^1.0.0 copied to clipboard

A Flutter package for easy Instagram login using OAuth authentication. Fetch user data seamlessly with just a few lines of code.

Instagram Login for Flutter πŸš€ #

A Flutter package for easy Instagram login using OAuth authentication. Fetch user data seamlessly with just a few lines of code.

Features 🌟 #

  • Secure OAuth-based login with Instagram.
  • Fetch user details (name, profile picture, followers, etc.).
  • Easy integration with your Flutter app.
  • Supports Meta developer account credentials.

Getting Started 🏁 #

Installation #

Add this package to your project by running:

flutter pub add flutter_instagram_api

Or, manually add it to your pubspec.yaml file:

dependencies:
flutter_instagram_api: latest_version

Usage πŸ“Œ #

Import the package:

import 'package:flutter_instagram_api/flutter_instagram_api.dart';

How to Use #

Use the following method to initiate the Instagram login process:

import 'package:flutter/material.dart';
import 'package:flutter_instagram_api/flutter_instagram_api.dart';

class FlutterInstagramApiScreen extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text("Instagram Login")),
      body: Center(
        child: ElevatedButton(
          onPressed: () {
            FlutterInstagramApi.login(
              context,
              instaConfig: InstaConfig(
                instaUrl: 'The URL from your Meta Developer Account',
                clientId: 'your_client_id',
                clientSecret: 'your_client_secret',
              ),
              userData: (data) {
                print('User Data:');
                print('User ID: ${data.userId}');
                print('ID: ${data.id}');
                print('Name: ${data.name}');
                print('Username: ${data.username}');
                print('Account Type: ${data.accountType}');
                print('Followers Count: ${data.followersCount}');
                print('Follows Count: ${data.followsCount}');
                print('Media Count: ${data.mediaCount}');
                print('Profile Picture URL: ${data.profilePictureUrl}');
              },
            );
          },
          child: const Text("Login with Instagram"),
        ),
      ),
    );
  }
}

Additional information ℹ️ #

For more details:

πŸ“– Meta Developer Account: Ensure your app is registered with Meta for Developers to obtain your Instagram API credentials. Make sure your app type is Business and that you have added Instagram in the Products section.

πŸ“– Configuration Details:

  1. Click on Instagram in the Products section, then select Set up API with Instagram Login.
  2. Here, you will find your Instagram App ID and App Secret, which correspond to your Client ID and Client Secret. Next Steps: βœ… Click on Set up Instagram Business Login (3-step process). βœ… Go to Business Login Settings and add your OAuth Redirect URIs. βœ… Copy the Embed URLβ€”this will be your instaUrl.

License πŸ“„ #

This package is licensed under the MIT License.

1
likes
0
points
374
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter package for easy Instagram login using OAuth authentication. Fetch user data seamlessly with just a few lines of code.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, http, webview_flutter

More

Packages that depend on flutter_instagram_api