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

social_embed_webview のカバー
パッケージ詳細v0.3.2

social_embed_webview

プラットフォームのWeb埋め込み機能を使用して、Flutterでソーシャルメディア投稿を簡単に埋め込むためのウィジェットを提供します。

AndroidiOS
30日間ダウンロード
27
いいね数
43
Pub ポイント
120

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

flutter pub add social_embed_webview

パッケージ概要

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

social_embed_webview パッケージは、Flutter開発者がプラットフォームのネイティブなウェブ埋め込み機能を使用して、アプリ内にソーシャルメディア投稿を簡単に埋め込むことを可能にします。このパッケージは、WebViewコンポーネントを利用して、ツイートやInstagram投稿、Facebookの更新など、ソーシャルコンテンツをアプリ内で直接レンダリングするシンプルなウィジェットを提供しています。このアプローチにより、動的なソーシャルメディアコンテンツとの互換性が保たれ、AndroidおよびiOSプラットフォーム間でスムーズなユーザー体験が実現されます。ソーシャルフィードや共有可能なコンテンツを統合するアプリに最適です。

用途

  • ニュースアプリにツイートを埋め込む
  • ソーシャルフィードにInstagram投稿を表示する
  • コミュニティアプリにFacebook投稿を統合する
  • コンテンツプラットフォームでYouTube動画を表示する
  • 共有可能なソーシャルコンテンツのプレビューを作成する

主な機能

  • ソーシャルメディア埋め込み用のシンプルなウィジェット
  • プラットフォームネイティブなウェブ埋め込みを使用
  • Android および iOS をサポートしています
  • 軽量で統合が簡単
  • 動的なソーシャルメディアコンテンツを処理

適している対象

  • ソーシャルメディア統合付きアプリ
  • ニュースおよびコンテンツ集約プラットフォーム
  • ソーシャルネットワーキングアプリ
  • マーケティングおよびプロモーションアプリ
  • 共有可能なメディアプレビューを必要とするアプリ

注意事項

  • インターネット接続に依存しています
  • Webアクセスに追加の権限が必要になる場合があります
  • パフォーマンスはネットワーク速度に依存します
  • 埋め込みコンテンツのカスタマイズが限定的
  • 外部のWebコンテンツに関するセキュリティ上の懸念

元の README

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

Social Embed WebView (Developers Preview)

Currently non of the major social media platform provides support to embed their post in a flutter app. This flutter package provides widgets to embed posts of various social media platforms using webview_flutter in the background.

Please note

  • version < 0.3.0 is not backward compatiable from this version. So please go through examples before upgrading

Content

Why Us

They are not many solutions in the community to solve this problem. All the packages use the same webview_flutter in the background but have a major issue of a predefined height. While this package adjusts the heights of the webview automatically according to the size of the embedded post.

Supported Platforms:

How to use?

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

dependencies:
  social_embed_webview: 0.3.1

2: You can install packages from the command line:

$ flutter packages get

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

3: Please visit webview_flutter and follow the steps required for implementations in Android and iOS respectively.

Example

Please make sure to remove <script>...</script> added by the platform with other embed code. Please visit examples for more detailed examples corresponding to each platform

import 'package:flutter/material.dart';
import 'package:social_embed_webview/platforms/twitter.dart';
import 'package:social_embed_webview/social_embed_webview.dart';

/// <srcipts>...</scripts> tag has been removed
String tweetContent = r"""
<blockquote class="twitter-tweet"><p lang="en" dir="ltr">Here’s an edit I did of one of my drawings. I tend to draw a lot of aot stuff when each chapter is released. Sorry about that!<br>Song: polnalyubvi кометы<br>Character: Annie Leonhart <a href="https://twitter.com/hashtag/annieleonhart?src=hash&amp;ref_src=twsrc%5Etfw">#annieleonhart</a> <a href="https://twitter.com/hashtag/aot131spoilers?src=hash&amp;ref_src=twsrc%5Etfw">#aot131spoilers</a> <a href="https://twitter.com/hashtag/aot?src=hash&amp;ref_src=twsrc%5Etfw">#aot</a> <a href="https://twitter.com/hashtag/AttackOnTitan131?src=hash&amp;ref_src=twsrc%5Etfw">#AttackOnTitan131</a> <a href="https://twitter.com/hashtag/AttackOnTitans?src=hash&amp;ref_src=twsrc%5Etfw">#AttackOnTitans</a> <a href="https://twitter.com/hashtag/snk?src=hash&amp;ref_src=twsrc%5Etfw">#snk</a> <a href="https://twitter.com/hashtag/snk131?src=hash&amp;ref_src=twsrc%5Etfw">#snk131</a> <a href="https://twitter.com/hashtag/shingekinokyojin?src=hash&amp;ref_src=twsrc%5Etfw">#shingekinokyojin</a> <a href="https://t.co/b4z48ruCoD">pic.twitter.com/b4z48ruCoD</a></p>&mdash; evie (@hazbin_freak22) <a href="https://twitter.com/hazbin_freak22/status/1291884358870142976?ref_src=twsrc%5Etfw">August 7, 2020</a></blockquote> """;

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      home: SafeArea(
        child: Scaffold(
          appBar: AppBar(
            title: const Text('Social Embed WebView Example'),
          ),
          body: SingleChildScrollView(
            child: Padding(
              padding: const EdgeInsets.all(8.0),
              child: Column(
                children: [
                  SocialEmbed(
                      socialMediaObj:
                          TwitterEmbedData(embedHtml: tweetContent)),
                ],
              ),
            ),
          ),
        ),
      ),
    );
  }
}

Output

Known Bugs

  • Media playback continuous incase of router.push() for all platform
  • Media playback continuous incase of app going in background for all platform except Youtube

カテゴリー

依存関係

依存関係一覧 4 件

ソースリポジトリ

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

データはまだありません。