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

outdated

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

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_instagram_image_picker/flutter_instagram_image_picker.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: ElevatedButton(
            child: Text("Continue with instagram"),
            onPressed: () async {

              bool isLogged = await InstagramAuth().isLogged;
              // check if user already logged in, if not log the user
              if (!isLogged) {
                bool loginStatus = await InstagramAuth().signUserIn(context);

                // if user canceled the operation
                if (!loginStatus)
                  return;
              }


              final accessMapData = await InstagramAuth().accessData;
              if(accessMapData == null){
                return null;
              }

              // After got the access data, can go to picker screen
              Navigator.push(
                context,
                MaterialPageRoute(
                  builder: (context) => InstagramImagePicker(
                    accessMapData,
                    showLogoutButton: true,
                    onDone: (items) {
                      items.forEach((element) {
                        print('selected: ${element.url}');
                      });
                      Navigator.pop(context);
                    },
                    onCancel: () => Navigator.pop(context),
                  ),
                ),
              );
            }),
      ),
    );
  }
}
25
likes
0
pub points
66%
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

unknown (LICENSE)

Dependencies

flutter, http, shared_preferences

More

Packages that depend on flutter_instagram_image_picker