搜尋套件、儲存庫與 APP 分類

套件詳情v1.0.2

esys_flutter_share

一個用於與其他應用程式共享圖片與文字的 Flutter 外掛程式。

近 30 天下載
3310
喜歡數
212
Pub 分數
30

安裝套件

flutter pub add esys_flutter_share

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

EsysFlutterShare 是一個 Flutter 插件,可透過原生分享意圖實現文字與影像與其他應用的無縫分享。它簡化了 Android 與 iOS 上的跨平台分享,讓使用者能直接從應用程式將內容傳送至社群媒體、訊息應用或電子郵件客戶端。此插件與 Flutter 生態系統順暢整合,設定簡單。支援分享純文字、URL 與影像檔,非常適合需要快速內容傳播的應用。該套件由 EsysBerlin 維護,並託管於 GitHub,以確保透明度與社群貢獻。

適用情境

  • 分享連結到社群媒體
  • 從應用發送圖片到其他應用
  • 透過分享表單分發文字內容
  • 啟用使用者產生內容分享
  • 與訊息平台整合

主要特色

  • 支援文字和圖片分享
  • 跨平台相容性
  • 簡單的 API,設定最少
  • 原生分享意圖整合
  • 開源且積極維護

適合對象

  • 社交媒體應用
  • 照片分享應用
  • 內容發現平台
  • 使用者產生的內容功能
  • 需要輕鬆外部分享的應用程式

使用建議

  • 某些設備需要平台特定的權限
  • 僅限基本分享功能
  • 無內建的分享表單自訂
  • 依賴原生作業系統分享對話方塊
  • 可能需要對大型圖像檔案進行額外處理

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

Important Note

We have decided to discontinue the development of this library to concentrate our efforts on other projects. You can use share_plus instead for example.

esys_flutter_share

A Flutter plugin for sharing files & text with other applications.

IMPORTANT Note for iOS

If you are starting a new fresh app, you need to create the Flutter App with flutter create -i swift (see flutter/flutter#13422 (comment)), otherwise, you will get this message:

=== BUILD TARGET flutter_inappbrowser OF PROJECT Pods WITH CONFIGURATION Debug ===
The "Swift Language Version" (SWIFT_VERSION) build setting must be set to a supported value for targets which use Swift. Supported values are: 3.0, 4.0, 4.2. This setting can be set in the build settings editor.

If you still have this problem, try to edit iOS Podfile like this (see #15):

target 'Runner' do
  use_frameworks!  # required by simple_permission
  ...
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['SWIFT_VERSION'] = '4.0'  # required by simple_permission
      config.build_settings['ENABLE_BITCODE'] = 'NO'
    end
  end
end

Instead, if you have already a non-swift project, you can check this issue to solve the problem: Friction adding swift plugin to objective-c project.

Usage

Import:

import 'package:esys_flutter_share/esys_flutter_share.dart';

Share text:

Share.text('my text title', 'This is my text to share with other applications.', 'text/plain');

Share file:

final ByteData bytes = await rootBundle.load('assets/image1.png');
await Share.file('esys image', 'esys.png', bytes.buffer.asUint8List(), 'image/png', text: 'My optional text.');

Share files:

final ByteData bytes1 = await rootBundle.load('assets/image1.png');
final ByteData bytes2 = await rootBundle.load('assets/image2.png');
final ByteData bytes3 = await rootBundle.load('assets/addresses.csv');

await Share.files(
    'esys images',
    {
        'esys.png': bytes1.buffer.asUint8List(),
        'bluedan.png': bytes2.buffer.asUint8List(),
        'addresses.csv': bytes3.buffer.asUint8List(),
    },
    '*/*',
    text: 'My optional text.');

Share file from url:

var request = await HttpClient().getUrl(Uri.parse('https://shop.esys.eu/media/image/6f/8f/af/amlog_transport-berwachung.jpg'));
var response = await request.close();
Uint8List bytes = await consolidateHttpClientResponseBytes(response);
await Share.file('ESYS AMLOG', 'amlog.jpg', bytes, 'image/jpg');

Check out the example app in the Repository for further information.

所屬分類

依賴

依賴清單 1 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。