video_editor_sdk 2.7.1 video_editor_sdk: ^2.7.1 copied to clipboard
The official Flutter plugin for VideoEditor SDK. Integrate the video editor into your own iOS or Android app - in minutes!
import 'package:flutter/material.dart';
import 'package:imgly_sdk/imgly_sdk.dart';
import 'package:video_editor_sdk/video_editor_sdk.dart';
void main() {
runApp(MyApp());
}
/// The example application for the video_editor_sdk plugin.
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
Configuration createConfiguration() {
final flutterSticker = Sticker(
"example_sticker_logos_flutter", "Flutter", "assets/Flutter-logo.png");
final imglySticker = Sticker(
"example_sticker_logos_imgly", "img.ly", "assets/IgorSticker.png");
/// A completely custom category.
final logos = StickerCategory(
"example_sticker_category_logos", "Logos", "assets/Flutter-logo.png",
items: [flutterSticker, imglySticker]);
/// A predefined category.
final emoticons =
StickerCategory.existing("imgly_sticker_category_emoticons");
/// A customized predefined category.
final shapes =
StickerCategory.existing("imgly_sticker_category_shapes", items: [
Sticker.existing("imgly_sticker_shapes_badge_01"),
Sticker.existing("imgly_sticker_shapes_arrow_02")
]);
/// A GIPHY sticker category.
// final giphy = StickerCategory.giphy(
// GiphyStickerProvider("YOUR-GIPHY-API-KEY"));
var categories = <StickerCategory>[logos, emoticons, shapes];
final configuration = Configuration(
sticker:
StickerOptions(personalStickers: true, categories: categories));
return configuration;
}
void presentEditor() async {
final result = await VESDK.openEditor(Video("assets/Skater.mp4"),
configuration: createConfiguration());
print(result?.toJson());
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('VideoEditor SDK Example'),
),
body: ListView.builder(
itemBuilder: (context, index) {
return ListTile(
title: Text("Open video editor"),
subtitle: Text("Click to edit a sample video."),
onTap: presentEditor,
);
},
itemCount: 1,
)),
);
}
}