-
Notifications
You must be signed in to change notification settings - Fork 29
/
main.dart
74 lines (64 loc) · 2.26 KB
/
main.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
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,
)),
);
}
}