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

套件詳情v0.0.10

whitecodel_reels

一個 Flutter 套件,可輕鬆將類似 Instagram 的短影片整合到您的應用程式中

AndroidiOSmacOS
近 30 天下載
91
喜歡數
27
Pub 分數
160

安裝套件

flutter pub add whitecodel_reels

套件介紹

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

whitecodel_reels 是一個 Flutter 套件,可讓開發者輕鬆將 Instagram 風格的短影片整合至應用程式中。它提供即用型、可自訂的影片資訊流,支援滑動手勢、自動播放與互動式控制。專為社群媒體應用設計,支援 Android、iOS 與 macOS 平台,透過簡單的 pub 命令即可實現順暢整合。此套件透過提供類似原生的短影片體驗,提升使用者參與度。

適用情境

  • 社群媒體應用
  • 影片內容平台
  • 使用者產生的內容 feeds
  • 行動應用程式增強功能
  • 互動敘事功能

主要特色

  • 滑動導航影片
  • 自動播放功能
  • 可自定義的 UI 組件
  • 跨平台支援(Android、iOS、macOS)
  • 與 Flutter 項目的輕鬆整合

適合對象

  • 開發社交應用的開發者
  • 尋求快速剪輯實現的團隊
  • 專注於短影片內容的應用
  • Flutter 初學者尋找預建元件
  • 需要原生影片體驗的專案

使用建議

  • 需要遵守平台特定的設計指南
  • 可能需要額外的樣式以保持品牌一致性
  • 依賴外部依賴項進行影片渲染
  • 效能可能在低階設備上有所差異
  • 超出所提供 API 之外的自定功能有限

原始 README

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

WhiteCodel Reels

Introduction

This package allows you to implement Instagram-like reels widgets in your Flutter application with minimal code. With whitecodel_reels, you can quickly add a reels widget featuring video content with interactive elements.

Features

  • Caching: The reels widget caches the video content to improve performance and reduce data usage.
  • Customizable: You can customize the reels widget with your own design and layout.
  • Interactive: You can add interactive elements to the reels widget.
  • Easy to use: You can easily integrate the reels widget in your Flutter application with minimal code.
  • Multiscreen Support: Use the controllerTag parameter to create multiple independent reels widgets on different screens or pages.

Installation

To use this package, add whitecodel_reels as a dependency in your pubspec.yaml file.

dependencies:
  whitecodel_reels: ^0.0.9+4

Android Configuration

For caching to work properly on Android, you need to add the following permissions to your AndroidManifest.xml file:

<uses-permission android:name="android.permission.INTERNET"/>

Also, ensure your application has the following configuration set:

<application
    android:networkSecurityConfig="@xml/network_security_config"
    ...
    >

And create a network security configuration file at android/app/src/main/res/xml/network_security_config.xml:

<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
  <base-config cleartextTrafficPermitted="true">
    <trust-anchors>
      <certificates src="system" />
    </trust-anchors>
  </base-config>

  <domain-config cleartextTrafficPermitted="true">
    <domain includeSubdomains="true">localhost</domain>
    <domain includeSubdomains="true">127.0.0.1</domain>
  </domain-config>
</network-security-config>

Usage Example

import 'package:flutter/material.dart';
import 'package:whitecodel_reels/models/video_model.dart';
import 'package:whitecodel_reels/whitecodel_reels.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  runApp(const MyApp());
}

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
        title: 'WhiteCodel Reels',
        theme: ThemeData(
          primarySwatch: Colors.blue,
        ),
        home: Scaffold(
          body: WhiteCodelReels(
              key: UniqueKey(),
              context: context,
              loader: const Center(
                child: CircularProgressIndicator(),
              ),
              videoList: List.generate(
                10,
                (index) => VideoModel(
                    url:
                        'https://flutter.github.io/assets-for-api-docs/assets/videos/butterfly.mp4'),
              ),
              isCaching: true,
              controllerTag: "home_reels", // Use a unique tag for each screen
              builder: (context, index, child, videoPlayerController,
                  pageController) {
                // Widget builder logic
                return child;
              }),
        ));
  }
}

Multiscreen Support

You can use multiple WhiteCodelReels widgets on different screens or pages by providing a unique controllerTag for each instance. This ensures each reels widget maintains its own state and playback independently.

// Example: Using different controllerTag for different screens
WhiteCodelReels(
  controllerTag: "home_reels",
  // ...other params...
);

WhiteCodelReels(
  controllerTag: "profile_reels",
  // ...other params...
);

Future Plans

  • Customizable: Add more customization options to the reels widget.
  • Speed Optimization: Improve the performance of the reels widget by optimizing the video loading speed.

AUTHOR

Bhawani Shankar

所屬分類

依賴

依賴清單 5 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。