패키지, 저장소 및 앱 카테고리 검색

flutter_instagram_stories 표지
패키지 상세v1.0.3+4

flutter_instagram_stories

WhatsApp 및 인스타그램처럼 스토리(비디오 및 이미지)를 표시합니다.

30일 다운로드
69
좋아요
176
Pub 점수
80

패키지 설치

flutter pub add flutter_instagram_stories

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

이미지 및 비디오 지원을 갖춘 스토리를 표시할 수 있도록 해주는 플러터 패키지로, 인스타그램과 월라플렛의 외관과 느낌을 모방합니다. 전체 화면에서 스와이프 가능한 형식으로 순차적인 미디어 콘텐츠를 제시하는 깔끔하고 사용자 정의 가능한 인터페이스를 제공합니다. 기존 앱에 쉽게 통합할 수 있도록 단순성과 편의성을 고려하여 설계되었습니다. 스토리 간 자동 전환을 지원하며, 외관과 동작을 사용자 정의할 수 있습니다. 소셜 앱, 메시징 플랫폼 또는 스토리처럼 느껴지는 경험을 필요로 하는 모든 앱에 적합합니다.

사용 사례

  • 소셜 미디어 앱
  • 메시징 애플리케이션
  • 콘텐츠 공유 플랫폼
  • 사용자 프로필 강조점
  • 인터랙티브 스토리텔링 기능

주요 기능

  • 이미지 및 비디오 스토리 지원
  • 스와이프 탐색
  • 스토리 간 자동 전환
  • 사용자 정의 가능한 UI
  • 전체 화면 프레젠테이션
  • pub.dev를 통한 간단한 통합

적합한 대상

  • 소셜 기능을 구축하는 개발자
  • 스토리처럼 인터페이스가 필요한 앱
  • 미디어가 풍부한 콘텐츠를 포함한 프로젝트
  • 모바일 우선 디자인 구현
  • 인터랙티브 피드의 빠른 프로토타이핑

고려 사항

  • 제한된 플랫폼별 최적화
  • 내장된 분석 추적 없음
  • 스토리 완료 이벤트를 수동으로 처리해야 합니다
  • 기본 사용법을 넘어서는 최소한의 문서
  • 스토리 답글 또는 반응 지원 없음

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

flutter_instagram_stories Pub

If you need a help to implement stories in your app, contact me https://github.com/awaik

A Flutter package for displaying stories just like Whatsapp & Instagram. Built-in groups (multiple stories with one icon), cache, video, gifs.

The package can be used in any app for displaying news, educational content and etc. Look the sample app here.

Note: This package is under active development, and there are some known bugs and a lot of features to implement. Please, add issues or feature requests here: issue

The project was initially copied from https://github.com/blackmann/story_view - great thanks for this excellent package. In case, you need more flexible functionality, you can check the original repository.

Showcase|100x100, 10%

Important notes:

  1. For now, the package works with Firebase only.
  2. This is a first beta version, please add all issues and feature requests here: issue

Features

  • Only one line of code to implement this package to the app.
  • Display images, gifs, videos.
  • Adjustable titles on icons.
  • Preliminary caching after app started.
  • Multilanguage support.
  • Callback when a user closed stories - helps to implement subscriptions after first launch and etc.

Installing

Look how to install here https://pub.dev/packages/flutter_instagram_stories#-installing-tab-

Now in your Dart code, you can use:

import 'package:flutter_instagram_stories/flutter_instagram_stories.dart';

iOS

For playing video, the package uses official video_player https://pub.dev/packages/video_player

From documentation:

  1. Warning: The video_player plugin doesn’t work on iOS simulators. You must test videos on real iOS devices.

  2. For iOS, add the following to the Info.plist file found at /ios/Runner/Info.plist.

<key>NSAppTransportSecurity</key>
  <dict>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
  </dict>

Usage

You can find a complete working example here https://github.com/awaik/flutter_instagram_stories/tree/master/example

Dart code

Connect to the collection where you keep stories

    static String collectionDbName = 'instagram_stories_db';
    CollectionReference dbInstance =
      Firestore.instance.collection(collectionDbName);

And add stories full functionality to your app.

    FlutterInstagramStories(
        collectionDbName: collectionDbName,
        showTitleOnIcon: true,
        backFromStories: () {
          _backFromStoriesAlert();
        },
        iconTextStyle: TextStyle(
          fontSize: 14.0,
          color: Colors.white,
        ),
        iconImageBorderRadius: BorderRadius.circular(15.0),
        iconBoxDecoration: BoxDecoration(
          borderRadius: BorderRadius.all(Radius.circular(15.0)),
          color: Color(0xFFffffff),
          boxShadow: [
            BoxShadow(
              color: Color(0xff333333),
              blurRadius: 10.0,
              offset: Offset(
                0.0,
                4.0,
              ),
            ),
          ],
        ),
        iconWidth: 150.0,
        iconHeight: 150.0,
        textInIconPadding:
            EdgeInsets.only(left: 8.0, right: 8.0, bottom: 12.0),
        //how long story lasts in seconds
        imageStoryDuration: 7,
        progressPosition: ProgressPosition.top,
        repeat: true,
        inline: false,
        languageCode: 'en',
        backgroundColorBetweenStories: Colors.black,
        closeButtonIcon: Icon(
          Icons.close,
          color: Colors.white,
          size: 28.0,
        ),
        closeButtonBackgroundColor: Color(0x11000000),
        sortingOrderDesc: true,
        lastIconHighlight: true,
        lastIconHighlightColor: Colors.deepOrange,
        lastIconHighlightRadius: const Radius.circular(15.0),
        captionTextStyle: TextStyle(
          fontSize: 22,
          color: Colors.white,
        ),
        captionMargin: EdgeInsets.only(
          bottom: 50,
        ),
        captionPadding: EdgeInsets.symmetric(
          horizontal: 24,
          vertical: 8,
        ),
      ),

Firestore database

The package works with Firestore database and package https://pub.dev/packages/cloud_firestore already included into the package.

You can use example with the sample database in the example folder, or, create your own database.

Steps to create:

  1. Add Firebase to your app
  • Android https://firebase.google.com/docs/flutter/setup?platform=android
  • iOS https://firebase.google.com/docs/flutter/setup?platform=ios
  1. Create Firestore database
  • Create a collection with any name. After you will use this name in dart code only once.
  • Create documents inside the collection with exact structure, like on the image below

Showcase|100x100, 10%

Important! Pay attention to array, map types. Otherwise you will have a null error https://github.com/awaik/flutter_instagram_stories/issues/20

Data structure

That's it! Now your app has instagram stories with caching and other powerful features.

Use cases in real apps

App for Android and iOS - https://lifext.app/

Lifext app

카테고리

의존성

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.