FLUTTER ECOSYSTEM

kfiross/flutter_instagram_image_picker

一个用于从 Instagram 挑选图片的 Flutter 包

flutter_instagram_image_picker 项目封面
Stars
3
Forks
10
最近推送(UTC)
2023年1月4日
项目状态
未归档
Kfir Matityahu GitHub avatar
GITHUB User

Kfir Matityahu ↗

语言DartHTMLSwiftKotlinObjective-C

此仓库发布的插件

使用的依赖

依赖清单 8 项

原始 README

以下为英文项目原文快照,最新内容请访问 GitHub。

展开 / 收起项目 README

flutter_instagram_image_picker

A Flutter package for picking images from Instagram

Getting Started

This plugin displays a gallery with user's Instagram Albums and Photos, based on the access token provided. It does handle authorization and login by itself.
Then just provides access data (userId+SessionKey) to the gallery.

Usage

1.Check if user has logged in, if not prompt him to enter his login data using by navigation to the InstagramLoginPage

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

2.Check if the user logged in successfully by accessing his data.

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

3.After we got the access data, we can navigate to InstagramImagePicker:

Navigator.push(
  context,
  MaterialPageRoute(
    builder: (context) => InstagramImagePicker(
      accessMapData,
      showLogoutButton: true,
      onDone: (photos) {
        // photos are the photos you selected in the picker
        // each one has the url
        Navigator.pop(context);
      },
      onCancel: () => Navigator.pop(context),
    ),
  ),
);
,

Screenshots

  • Login Page:

https://raw.githubusercontent.com/kfiross/flutter_instagram_image_picker/HEAD/images/login_filled.png

  • Image Picker:

https://raw.githubusercontent.com/kfiross/flutter_instagram_image_picker/HEAD/images/picker_page.png

  • Image Picker (after selection):

https://raw.githubusercontent.com/kfiross/flutter_instagram_image_picker/HEAD/images/picker_page_selected.png