flutter_instagram_image_picker 0.3.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 71

flutter_instagram_image_picker #

A Flutter package for picking images from Instagram

Getting Started #

This plugins displays a gallery with user's Instagram Albums and Photos, based on the access token provided. It does handle authorization and login by itself. and then just provides access token to the gallery.

[0.3.1] #

  • added missing loading gif

[0.3.0] #

  • pagination works now good, load 20 more photos each paging

[0.2.0] #

  • updated example because the package more flexible now
  • fixed bug of logging in every time, added wrap auth of Instagram to remember past login

[0.1.0] #

  • added Example

[0.0.1] #

  • Initial release

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),
                  ),
                ),
              );
            }),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  flutter_instagram_image_picker: ^0.3.1

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:flutter_instagram_image_picker/flutter_instagram_image_picker.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
42
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
71
Learn more about scoring.

We analyzed this package on Feb 26, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.5
  • Flutter: 1.12.13+hotfix.8

Health suggestions

Fix lib/picker.dart. (-0.50 points)

Analysis of lib/picker.dart reported 1 hint:

line 56 col 21: The value of the field '_imageListPosition' isn't used.

Format lib/InstagramAuth.dart.

Run flutter format to format lib/InstagramAuth.dart.

Format lib/model/pagination.dart.

Run flutter format to format lib/model/pagination.dart.

Fix additional 4 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/model/photo.dart (Run flutter format to format lib/model/photo.dart.)
  • lib/model/photo_paging.dart (Run flutter format to format lib/model/photo_paging.dart.)
  • lib/screens.dart (Run flutter format to format lib/screens.dart.)
  • lib/ui/photo_grid.dart (Run flutter format to format lib/ui/photo_grid.dart.)

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
flutter_webview_plugin ^0.3.10+1 0.3.10+1
http ^0.12.0 0.12.0+4
shared_preferences ^0.5.5 0.5.6+2
Transitive dependencies
async 2.4.0
charcode 1.1.3
collection 1.14.11 1.14.12
flutter_web_plugins 0.0.0
http_parser 3.1.3
meta 1.1.8
path 1.6.4
pedantic 1.9.0
shared_preferences_macos 0.0.1+6
shared_preferences_platform_interface 1.0.3
shared_preferences_web 0.1.2+4
sky_engine 0.0.99
source_span 1.6.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test