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

stories_editor 封面
套件詳情v0.2.2

stories_editor

這是一個以 Instagram 故事創作者風格建立的套件,可讓您創建包含圖片、文字、貼紙(GIF)和手指繪圖的影像。

近 30 天下載
45
喜歡數
108
Pub 分數
55

安裝套件

flutter pub add stories_editor

套件介紹

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

stories_editor 套件讓使用者能在 Flutter 應用中建立類似 Instagram 的故事。支援加入圖片、文字、動畫貼紙(GIF)以及以手指輸入進行自由繪製。專為多媒體編輯設計,可實時組合、自訂並匯出故事。此套件非常適合社交媒體功能、內容創作工具或互動式敘事應用。著重於簡潔性與效能,能順暢整合至現有的 Flutter 專案中。

適用情境

  • 社交媒體故事創作
  • 使用者產生內容工具
  • 互動敘事應用
  • 帶有疊加效果的照片編輯
  • 即時繪圖功能
  • 動態貼紙整合

主要特色

  • 圖像疊加支援
  • 帶樣式的文本添加
  • 動畫GIF貼紙
  • 手指繪圖畫布
  • 即時預覽
  • 匯出和儲存功能

適合對象

  • 開發社交應用的開發者
  • 內容創作者需要故事工具
  • 需要多媒體編輯的應用程式
  • Flutter 初學者探索 UI 組件
  • 具有互動式繪圖需求的項目

使用建議

  • 有限的平台支援(未指定平台)
  • 需要手動處理圖像/GIF資源
  • 性能可能因複雜組合而有所不同
  • 未提及任何內建壓縮選項
  • 依賴外部資產管理

原始 README

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

I won't be giving support or any update for a while beacuse i don't have time to spend in this project.

Flutter version 3.3.6

Previous branches was deleted (4-Nov-2022)

if you want to make a ull request you must be using the new "main" branch, the problems with gallery, overflow design were solved and the function to create Gif / mp4 was removed due to performance issues.

flutter stories editor

This is a package created in the style of the instagram story creator, with which you can create images with images, texts, stickers (Gifs), finger drawing. They can be exported as an image to the gallery or shared directly to social networks.

Features

[✔️] Draggable image

[✔️] Draggable text

[✔️] Draggable Gif/Sticker (giphy API)

[✔️] Gradient container background

[✔️] Finger painting (normal/translucent/neon)

[✔️] Custom colors, gradients and font families

[✔️] Custom gallery picker (own package => gallery_media_picker)

[✔️] Save draft as image

[✔️] Get draft local path uri

[✔️] Text animations => animated_text_kit

Future features

[❌] Save draft as a gif / video

[❌] Color filters

Demo

If you don't see the images go to the github repository and by the way give me a star :D

showcase gif showcase gif

Installation

This package has been tested in Android and ios, some features works on flutter web

Add stories_editor: 0.1.8 to your pubspec.yaml dependencies and then import it.

import 'package:stories_editor/stories_editor.dart';

How to use

  1. Android

    add uses-permission AndroidMAnifest.xml file

     <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
         android:maxSdkVersion="31" />
     <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
     <uses-permission android:name="android.permission.INTERNET" />
     <uses-permission android:name="android.permission.VIBRATE"/>
    
    ios

    add this config to your config.plist

    <key>NSPhotoLibraryUsageDescription</key>
    <string>Privacy - Photo Library Usage Description</string>
    <key>NSMotionUsageDescription</key>
    <string>Motion usage description</string>
    <key>NSPhotoLibraryAddUsageDescription</key>
    <string>NSPhotoLibraryAddUsageDescription</string>
    
  2. Create a StoriesEditor() widget with the follow params:

StoriesEditor(
    giphyKey: '[YOUR GIPHY API KEY]', /// (String) required param
    onDone: (String uri){
      /// uri is the local path of final render Uint8List
      /// here your code
    },
    colorList: [] /// (List<Color>[]) optional param 
    gradientColors: [] /// (List<List<Color>>[]) optional param 
    middleBottomWidget: Container() /// (Widget) optional param, you can add your own logo or text in the bottom tool
    fontFamilyList: [] /// (List<String>) optional param
    isCustomFontList: '' /// (bool) if you use a own font list set value to "true"
    onDoneButtonStyle: Container() /// (Widget) optional param, you can create your own button style
    onBackPress: /// (Future<bool>) optional param, here you can add yor own style dialog
    editorBackgroundColor: /// (Color) optional param, you can define your own background editor color
    galleryThumbnailQuality: /// (int = 200) optional param, you can set the gallery thumbnail quality (higher is better but reduce the performance)
);

Example

import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:share_plus/share_plus.dart';
import 'package:stories_editor/stories_editor.dart';

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

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);
  
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter stories editor Demo',
      theme: ThemeData(

        primarySwatch: Colors.blue,
      ),
      home: const Example(),
    );
  }
}

class Example extends StatefulWidget {
  const Example({Key? key}) : super(key: key);



  @override
  State<Example> createState() => _ExampleState();
}

class _ExampleState extends State<Example> {

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        backgroundColor: Colors.black,
        resizeToAvoidBottomInset: false,
        body: Center(
          child: ElevatedButton(
            onPressed: (){
              Navigator.push(context, MaterialPageRoute(builder: (context) => StoriesEditor(
                giphyKey: '[HERE YOUR API KEY]',
                onDone: (uri){
                  debugPrint(uri);
                  Share.shareFiles([uri]);
                },
              ))
              );
            },
            child: const Text('Open Stories Editor'),
          ),
        )
    );
  }
}

Issues
  1. Issue of photo_View: photo_view#499 Issue log => To safely refer to a widget's ancestor in its dispose() method, save a reference to the ancestor by calling dependOnInheritedWidgetOfExactType() in the widget's didChangeDependencies() method.

ScreenShots

initial view

Custom image picker made with Photo_manager package

Gradient background taking image color pixel

Exit Dialog

Custom Gif Picker made with a fork of Giphy_picker package

Custom finger Drawing made with perfect_freehand package

Text Editor

All features together

Share to social networks made with share_plus package

Saved image

所屬分類

依賴

依賴清單 12 項

原始碼儲存庫

使用此套件的專案