搜索插件、代码仓与 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 项

源码仓库

使用此插件的项目

暂无相关数据。