flutter_instagram_image_picker 0.3.1 copy "flutter_instagram_image_picker: ^0.3.1" to clipboard
flutter_instagram_image_picker: ^0.3.1 copied to clipboard

outdated

Flutter plugin that allows you to display Instagram multi image picker on iOS and Android.

example/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_instagram_image_picker/InstagramAuth.dart';
import 'package:flutter_instagram_image_picker/flutter_instagram_image_picker.dart';
import 'package:flutter_instagram_image_picker/screens.dart';

void main() => runApp(
      MaterialApp(
        title: 'Instagram picker Demo',
        theme: ThemeData(primarySwatch: Colors.blue),
        home: LoginPage(),
        debugShowCheckedModeBanner: false,
      ),
    );

class LoginPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Instagram login demo'),
      ),
      body: Center(
        child: RaisedButton(
            child: Text("Continue with instagram"),
            onPressed: () async {
              var accessToken;

              accessToken = await InstagramAuth().accessToken;
              // check if user already logged in, if not log the user using the
              // WebView interface
              if (accessToken == null) {
                accessToken = await Navigator.push(
                    context,
                    MaterialPageRoute(
                      builder: (_) => InstagramWebViewLoginPage(),
                    ));

                // if user canceled the operation
                if (accessToken == null) return;
              }

              // after got access token, can go to picker screen
              Navigator.push(
                context,
                MaterialPageRoute(
                  builder: (context) => InstagramImagePicker(
                    accessToken,
                    showLogoutButton: true,
                    onDone: (items) {
                      Navigator.pop(context);
                    },
                    onCancel: () => Navigator.pop(context),
                  ),
                ),
              );
            }),
      ),
    );
  }
}
25
likes
40
pub points
62%
popularity

Publisher

unverified uploader

Flutter plugin that allows you to display Instagram multi image picker on iOS and Android.

Repository (GitHub)
View/report issues

License

BSD-3-Clause (LICENSE)

Dependencies

flutter, flutter_webview_plugin, http, shared_preferences

More

Packages that depend on flutter_instagram_image_picker