パッケージ、リポジトリ、アプリカテゴリを検索

story_view のカバー
パッケージ詳細v0.16.6

story_view

WhatsApp や Instagram のようにストーリーを表示します。Google ニュースアプリのように、ListView や Column 内でインラインで使用できます。一時停止、前へ進む、前のページに戻るなどのジェスチャーが付いています。

AndroidiOSmacOS
30日間ダウンロード
2.2万
いいね数
822
Pub ポイント
150

パッケージをインストール

flutter pub add story_view

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

StoryView は、WhatsApp や Instagram のようなインタラクティブでスワイプ可能なストーリーを表示できる Flutter パッケージです。リストやカラム内に組み込み可能で、ニュースフィードやソーシャルメディアアプリに最適です。パッケージには、ストーリーページの一時停止、進める、ページ間のナビゲーションなどの組み込みジェスチャーが含まれています。クロスプラットフォームでのスムーズなパフォーマンスを実現するように設計されており、Android、iOS、macOS でシームレスに動作します。pub add による最小限のセットアップで、カスタマイズ可能なコントロールとアニメーションを備えたネイティブ風のストーリーテリング体験を提供します。

用途

  • ソーシャルメディアのストーリー投稿フィード
  • ニュースアプリのコンテンツが表示されます
  • アプリ内ストーリーテリング機能
  • ユーザー参加キャンペーン
  • インタラクティブ製品ツアー

主な機能

  • ストーリー間のスワイプナビゲーション
  • 一時停止および再開機能
  • ジェスチャーによるコントロール
  • ListView/Column におけるインライン配置
  • クロスプラットフォーム対応(Android、iOS、macOS)

適している対象

  • インスタグラム風のストーリーUIを必要とするアプリ
  • コンテンツ重視のアプリケーション
  • エンゲージメント駆動型のモバイル体験
  • 簡単なストーリー実装を求める開発者
  • 豊富なジェスチャー操作を必要とするプロジェクト

注意事項

  • 長いストーリーのシーケンスに対して最適化が必要になる場合があります
  • ストーリーカードデザインのカスタマイズが限定的
  • 完全な機能を実現するには、外部の画像/動画の読み込みに依存します
  • 基本的なトランジションを超える複雑なアニメーションには適していません
  • 高解像度のメディアを使用するとパフォーマンスが異なる場合があります

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

story_view Pub

Story view for apps with stories.

story_view

🍟 Watch video demo here: story_view demo

👨‍🚀 Demo project here: storyexample

This a Flutter widget to display stories just like Whatsapp and Instagram. Can also be used inline/inside ListView or Column just like Google News app. Comes with gestures to pause, forward and go to previous page.

Features

🕹 Still image, GIF and video support (with caching enabled)

📍 Gesture for pause, rewind and forward

⚜️ Caption for each story item

🎈 Animated progress indicator for each story item

📱 Fullscreen or inline

And useful callback to perform meta functionalities including vertical swipe gestures.

Installation

To use this plugin, add story_view as a dependency in your pubspec.yaml file.

Usage

Import the package into your code

import "package:story_view/story_view.dart";

Look inside examples/example.dart on how to use this library. You can copy and paste the code into your main.dart and run to have a quick look.

Basics

Use StoryView to add stories to screen or view heirarchy. StoryView requires a list of StoryItem, each of which describes the view to be displayed on each story page, duration and so forth. This gives you the freedom to customize each page of the story.

There are shorthands provided to create common pages.

StoryItem.text is a shorthand to create a story page that displays only text.

StoryItem.pageImage creates a story item to display images with a caption.

StoryItem.inlineImage creates a story item that is intended to be displayed in a linear view hierarchy like List or Column

🍭 Both .inlineImage and pageImage support animated GIFs.

StoryItem.pageVideo creates a page story item with video media. Just provide your video url and get going.

Story controller, loaders and GIF support

While images load, it'll be a better experience to pause the stories until it's done. To achieve this effect, create a global instance of StoryController and use the shorthand StoryItem.pageImage or StoryItem.inlineImage while passing the same controller instance to it.

...
final controller = StoryController();

@override
Widget build(context) {
  List<StoryItem> storyItems = [
    StoryItem.text(...),
    StoryItem.pageImage(...),
    StoryItem.pageImage(...),
    StoryItem.pageVideo(
      ...,
      controller: controller,
    )
  ]; // your list of stories

  return StoryView(
    storyItems,
    controller: controller, // pass controller here too
    repeat: true, // should the stories be slid forever
    onStoryShow: (s) {notifyServer(s)},
    onComplete: () {},
    onVerticalSwipeComplete: (direction) {
      if (direction == Direction.down) {
        Navigator.pop(context);
      }
    } // To disable vertical swipe gestures, ignore this parameter.
      // Preferrably for inline story view.
  )
}

🍭 Now, tell your users some stories.

Docs

Find docs from here: pub.dev/story_view

カテゴリー

依存関係

依存関係一覧 4 件

ソースリポジトリ

このパッケージを使用しているプロジェクト