Skip to content

Commit

Permalink
initial release
Browse files Browse the repository at this point in the history
  • Loading branch information
AdnanKhan45 committed Apr 18, 2024
0 parents commit ee8a271
Show file tree
Hide file tree
Showing 286 changed files with 3,880 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .flutter-plugins
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# This is a generated file; do not edit or check into version control.
ffmpeg_kit_flutter=/Users/amirkhan/.pub-cache/hosted/pub.dev/ffmpeg_kit_flutter-6.0.3/
file_picker=/Users/amirkhan/.pub-cache/hosted/pub.dev/file_picker-8.0.1/
flutter_keyboard_visibility=/Users/amirkhan/.pub-cache/hosted/pub.dev/flutter_keyboard_visibility-6.0.0/
flutter_keyboard_visibility_linux=/Users/amirkhan/.pub-cache/hosted/pub.dev/flutter_keyboard_visibility_linux-1.0.0/
flutter_keyboard_visibility_macos=/Users/amirkhan/.pub-cache/hosted/pub.dev/flutter_keyboard_visibility_macos-1.0.0/
flutter_keyboard_visibility_web=/Users/amirkhan/.pub-cache/hosted/pub.dev/flutter_keyboard_visibility_web-2.0.0/
flutter_keyboard_visibility_windows=/Users/amirkhan/.pub-cache/hosted/pub.dev/flutter_keyboard_visibility_windows-1.0.0/
flutter_plugin_android_lifecycle=/Users/amirkhan/.pub-cache/hosted/pub.dev/flutter_plugin_android_lifecycle-2.0.19/
image_cropper=/Users/amirkhan/.pub-cache/hosted/pub.dev/image_cropper-5.0.1/
image_cropper_for_web=/Users/amirkhan/.pub-cache/hosted/pub.dev/image_cropper_for_web-3.0.0/
path_provider=/Users/amirkhan/.pub-cache/hosted/pub.dev/path_provider-2.1.3/
path_provider_android=/Users/amirkhan/.pub-cache/hosted/pub.dev/path_provider_android-2.2.4/
path_provider_foundation=/Users/amirkhan/.pub-cache/hosted/pub.dev/path_provider_foundation-2.3.2/
path_provider_linux=/Users/amirkhan/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/
path_provider_windows=/Users/amirkhan/.pub-cache/hosted/pub.dev/path_provider_windows-2.2.1/
video_player=/Users/amirkhan/.pub-cache/hosted/pub.dev/video_player-2.8.6/
video_player_android=/Users/amirkhan/.pub-cache/hosted/pub.dev/video_player_android-2.4.14/
video_player_avfoundation=/Users/amirkhan/.pub-cache/hosted/pub.dev/video_player_avfoundation-2.5.7/
video_player_web=/Users/amirkhan/.pub-cache/hosted/pub.dev/video_player_web-2.3.0/
video_thumbnail=/Users/amirkhan/.pub-cache/hosted/pub.dev/video_thumbnail-0.5.3/
1 change: 1 addition & 0 deletions .flutter-plugins-dependencies
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"ffmpeg_kit_flutter","path":"/Users/amirkhan/.pub-cache/hosted/pub.dev/ffmpeg_kit_flutter-6.0.3/","native_build":true,"dependencies":[]},{"name":"file_picker","path":"/Users/amirkhan/.pub-cache/hosted/pub.dev/file_picker-8.0.1/","native_build":true,"dependencies":[]},{"name":"flutter_keyboard_visibility","path":"/Users/amirkhan/.pub-cache/hosted/pub.dev/flutter_keyboard_visibility-6.0.0/","native_build":true,"dependencies":[]},{"name":"image_cropper","path":"/Users/amirkhan/.pub-cache/hosted/pub.dev/image_cropper-5.0.1/","native_build":true,"dependencies":[]},{"name":"path_provider_foundation","path":"/Users/amirkhan/.pub-cache/hosted/pub.dev/path_provider_foundation-2.3.2/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"video_player_avfoundation","path":"/Users/amirkhan/.pub-cache/hosted/pub.dev/video_player_avfoundation-2.5.7/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"video_thumbnail","path":"/Users/amirkhan/.pub-cache/hosted/pub.dev/video_thumbnail-0.5.3/","native_build":true,"dependencies":[]}],"android":[{"name":"ffmpeg_kit_flutter","path":"/Users/amirkhan/.pub-cache/hosted/pub.dev/ffmpeg_kit_flutter-6.0.3/","native_build":true,"dependencies":[]},{"name":"file_picker","path":"/Users/amirkhan/.pub-cache/hosted/pub.dev/file_picker-8.0.1/","native_build":true,"dependencies":["flutter_plugin_android_lifecycle"]},{"name":"flutter_keyboard_visibility","path":"/Users/amirkhan/.pub-cache/hosted/pub.dev/flutter_keyboard_visibility-6.0.0/","native_build":true,"dependencies":[]},{"name":"flutter_plugin_android_lifecycle","path":"/Users/amirkhan/.pub-cache/hosted/pub.dev/flutter_plugin_android_lifecycle-2.0.19/","native_build":true,"dependencies":[]},{"name":"image_cropper","path":"/Users/amirkhan/.pub-cache/hosted/pub.dev/image_cropper-5.0.1/","native_build":true,"dependencies":[]},{"name":"path_provider_android","path":"/Users/amirkhan/.pub-cache/hosted/pub.dev/path_provider_android-2.2.4/","native_build":true,"dependencies":[]},{"name":"video_player_android","path":"/Users/amirkhan/.pub-cache/hosted/pub.dev/video_player_android-2.4.14/","native_build":true,"dependencies":[]},{"name":"video_thumbnail","path":"/Users/amirkhan/.pub-cache/hosted/pub.dev/video_thumbnail-0.5.3/","native_build":true,"dependencies":[]}],"macos":[{"name":"ffmpeg_kit_flutter","path":"/Users/amirkhan/.pub-cache/hosted/pub.dev/ffmpeg_kit_flutter-6.0.3/","native_build":true,"dependencies":[]},{"name":"flutter_keyboard_visibility_macos","path":"/Users/amirkhan/.pub-cache/hosted/pub.dev/flutter_keyboard_visibility_macos-1.0.0/","native_build":false,"dependencies":[]},{"name":"path_provider_foundation","path":"/Users/amirkhan/.pub-cache/hosted/pub.dev/path_provider_foundation-2.3.2/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"video_player_avfoundation","path":"/Users/amirkhan/.pub-cache/hosted/pub.dev/video_player_avfoundation-2.5.7/","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"linux":[{"name":"flutter_keyboard_visibility_linux","path":"/Users/amirkhan/.pub-cache/hosted/pub.dev/flutter_keyboard_visibility_linux-1.0.0/","native_build":false,"dependencies":[]},{"name":"path_provider_linux","path":"/Users/amirkhan/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/","native_build":false,"dependencies":[]}],"windows":[{"name":"flutter_keyboard_visibility_windows","path":"/Users/amirkhan/.pub-cache/hosted/pub.dev/flutter_keyboard_visibility_windows-1.0.0/","native_build":false,"dependencies":[]},{"name":"path_provider_windows","path":"/Users/amirkhan/.pub-cache/hosted/pub.dev/path_provider_windows-2.2.1/","native_build":false,"dependencies":[]}],"web":[{"name":"file_picker","path":"/Users/amirkhan/.pub-cache/hosted/pub.dev/file_picker-8.0.1/","dependencies":[]},{"name":"flutter_keyboard_visibility_web","path":"/Users/amirkhan/.pub-cache/hosted/pub.dev/flutter_keyboard_visibility_web-2.0.0/","dependencies":[]},{"name":"image_cropper_for_web","path":"/Users/amirkhan/.pub-cache/hosted/pub.dev/image_cropper_for_web-3.0.0/","dependencies":[]},{"name":"video_player_web","path":"/Users/amirkhan/.pub-cache/hosted/pub.dev/video_player_web-2.3.0/","dependencies":[]}]},"dependencyGraph":[{"name":"ffmpeg_kit_flutter","dependencies":[]},{"name":"file_picker","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"flutter_keyboard_visibility","dependencies":["flutter_keyboard_visibility_linux","flutter_keyboard_visibility_macos","flutter_keyboard_visibility_web","flutter_keyboard_visibility_windows"]},{"name":"flutter_keyboard_visibility_linux","dependencies":[]},{"name":"flutter_keyboard_visibility_macos","dependencies":[]},{"name":"flutter_keyboard_visibility_web","dependencies":[]},{"name":"flutter_keyboard_visibility_windows","dependencies":[]},{"name":"flutter_plugin_android_lifecycle","dependencies":[]},{"name":"image_cropper","dependencies":["image_cropper_for_web"]},{"name":"image_cropper_for_web","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"video_player","dependencies":["video_player_android","video_player_avfoundation","video_player_web"]},{"name":"video_player_android","dependencies":[]},{"name":"video_player_avfoundation","dependencies":[]},{"name":"video_player_web","dependencies":[]},{"name":"video_thumbnail","dependencies":[]}],"date_created":"2024-04-18 14:45:16.049397","version":"3.19.0"}
29 changes: 29 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
migrate_working_dir/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/

# Flutter/Dart/Pub related
# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
/pubspec.lock
**/doc/api/
.dart_tool/
build/
10 changes: 10 additions & 0 deletions .metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.

version:
revision: "bae5e49bc2a867403c43b2aae2de8f8c33b037e4"
channel: "stable"

project_type: package
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 0.0.1

* Initial release of *Flutter Story Editor*
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Muhammad Adnan

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
164 changes: 164 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
# flutter_story_editor [![Pub](https://img.shields.io/pub/v/flutter_story_editor.svg)](https://pub.dev/packages/flutter_story_editor)

This package is created using style of the WhatsApp story image/video editor, with which you can edit images and videos both together. You can add texts, stickers, freehand finger drawing, apply filter, and undo. The edited images will be returned in a **onSave** call back as **List of Files**. You can then upload it to some storage or save it locally to your gallery.

>> Video editing for now only support trimming. In future more video editing features will be added.
## Features

✅ You can edit Images, and videos both together.

✅ Draggable fancy text with (custom colors, font families, and resize)

✅ Draggable stickers & emojis

✅ Apply filters to images

✅ Freehand drawing over images

✅ Trimming video frames

## Future features

🚀 Drawing painting over video frames (requires platform specific work)

🚀 More image and video editing functionality like (WhatsApp & Instagram) stories

🚀 The UI is currently like WhatsApp, but I think we should go with something unique for flutter (your contribution & ideas will be very invaluable)

🚀 improve and enhance performance and existing features.

## Package Demo

<p float="left">

<img src="https://media.giphy.com/media/JubXlSh0KAlZjKnqRW/giphy.gif" width=200 />
<img src="https://res.cloudinary.com/dor7mejda/image/upload/v1713443118/Screen_Recording_2024-04-18_at_5.09.25_PM_kdfpza.gif" width=200>
<img src="https://res.cloudinary.com/dor7mejda/image/upload/v1713443118/Screen_Recording_2024-04-18_at_5.06.32_PM_vdirgz.gif" width=200>

</p>

## Installation

Add flutter_story_editor: latest_version to your **pubspec.yaml** and then import it.

```dartimport 'package:stories_editor/stories_editor.dart';```

### Android
add the following code to your `AndroidMAnifest.xml` file
```xml
<activity
android:name="com.yalantis.ucrop.UCropActivity"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>
```
### iOS
add the following code to your `info.plist` file

```xml
<key>NSCameraUsageDescription</key>
<string>Used to demonstrate image picker plugin</string>
<key>NSMicrophoneUsageDescription</key>
<string>Used to capture audio for image picker plugin</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Used to demonstrate image picker plugin</string>
```
## How to use
```dart
// Inialize controllers within the state
FlutterStoryEditorController controller = FlutterStoryEditorController();
final TextEditingController _captionController = TextEditingController();
// TODO: create a method to pick files (videos and images) either separate or together.
// Select files
selectMedia().then((value) {
if (_selectedMedia != null && _selectedMedia!.isNotEmpty) {
showModalBottomSheet(
isScrollControlled: true,
isDismissible: false,
enableDrag: false,
context: context,
builder: (context) {
return FlutterStoryEditor(
controller: controller,
captionController: _captionController,
selectedFiles: _selectedMedia,
onSaveClickListener: (files) {
// Here you go with your edited files.
}
);
},
);
}
},
);
}, icon: const Icon(Icons.upload, size: 50,)),
),
```

For more information : visit example project inside `example/example.dart`.

## Screenshots

Initial view & Multiple images selected

<p float="left">

<img src="https://i.imgur.com/plIVQiJ.jpg" width=200 />
<img src="https://i.imgur.com/Aw91PkQ.png" width=200 />

</p>

Images & videos together & Apply filters

<p float="left">

<img src="https://i.imgur.com/XDCMooh.jpg" width=200 />
<img src="https://i.imgur.com/S6PlaCM.png" width=200 />

</p>

Crop, scale and rotate & Add draggable stickers

<p float="left">

<img src="https://i.imgur.com/w7akoHi.jpg" width=200 />
<img src="https://i.imgur.com/X3K4pFK.png" width=200 />

</p>

Add emojis & Add draggable fancy text

<p float="left">

<img src="https://i.imgur.com/Hkm9VOF.jpg" width=200 />
<img src="https://i.imgur.com/iByPB5R.png" width=200 />
<img src="https://i.imgur.com/jMDUWek.png" width=200 />

</p>

Draw freehand painting over images

<p float="left">

<img src="https://i.imgur.com/Nm3jgOa.jpg" width=200 />
<img src="https://i.imgur.com/5qsogMC.png" width=200 />

</p>


## Must read

The initial release of `flutter_story_editor` may have small bugs, and issues. If you found some, and you're willing to contribute feel free to create issue and rasie a PR. Make sure you inform me through my [LinkedIn DM](https://www.linkedin.com/in/muhammad-adnan-23bb8821b/) for the issues you create in both cases either or not if you want to contribute.

This package will be improved more along the time, your contribution will be very invaluable.


## Created & Maintained By

[@MuhammadAdnan](https://github.com/AdnanKhan45), LinkedIn : [@MuhammadAdnan](https://www.linkedin.com/in/muhammad-adnan-23bb8821b/) , Instagram : [@MuhammadAdnan](https://www.instagram.com/dev.adnankhan/).

YouTube : [@eTechViral](https://www.youtube.com/c/eTechViral)
4 changes: 4 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
include: package:flutter_lints/flutter.yaml

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
Binary file added assets/emojies/e1511.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/emojies/e1512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/emojies/e1513.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/emojies/e1514.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/emojies/e1515.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/emojies/e1516.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/emojies/e1517.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/emojies/e1518.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/emojies/e1519.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/emojies/e1520.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/emojies/e1521.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/emojies/e1522.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/emojies/e1523.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/emojies/e1524.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/emojies/e1525.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/emojies/e1526.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/emojies/e1527.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/emojies/e1528.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/emojies/e1529.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/emojies/e1530.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/emojies/e1531.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/emojies/e1532.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/emojies/e1533.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/emojies/e1534.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/emojies/e1535.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/emojies/e1536.png
Binary file added assets/emojies/e1537.png
Binary file added assets/emojies/e1538.png
Binary file added assets/emojies/e1539.png
Binary file added assets/emojies/e1540.png
Binary file added assets/emojies/e1541.png
Binary file added assets/emojies/e1542.png
Binary file added assets/emojies/e1543.png
Binary file added assets/emojies/e1544.png
Binary file added assets/emojies/e1545.png
Binary file added assets/emojies/e1546.png
Binary file added assets/emojies/e1547.png
Binary file added assets/emojies/e1548.png
Binary file added assets/emojies/e1549.png
Binary file added assets/emojies/e1550.png
Binary file added assets/emojies/e1551.png
Binary file added assets/emojies/e1552.png
Binary file added assets/emojies/e1553.png
Binary file added assets/emojies/e1554.png
Binary file added assets/emojies/e1555.png
Binary file added assets/emojies/e1556.png
Binary file added assets/emojies/e1557.png
Binary file added assets/emojies/e1558.png
Binary file added assets/emojies/e1559.png
Binary file added assets/emojies/e1560.png
Binary file added assets/emojies/e1561.png
Binary file added assets/emojies/e1562.png
Binary file added assets/emojies/e1563.png
Binary file added assets/emojies/e1564.png
Binary file added assets/emojies/e1565.png
Binary file added assets/emojies/e1566.png
Binary file added assets/emojies/e1567.png
Binary file added assets/emojies/e1568.png
Binary file added assets/emojies/e1569.png
Binary file added assets/emojies/e1570.png
Binary file added assets/emojies/e1571.png
Binary file added assets/emojies/e1572.png
Binary file added assets/emojies/e1573.png
Binary file added assets/emojies/e1574.png
Binary file added assets/emojies/e1575.png
Binary file added assets/emojies/e1576.png
Binary file added assets/emojies/e1577.png
Binary file added assets/emojies/e1578.png
Binary file added assets/emojies/e1579.png
Binary file added assets/emojies/e1580.png
Binary file added assets/emojies/e1581.png
Binary file added assets/emojies/e1582.png
Binary file added assets/emojies/e1583.png
Binary file added assets/emojies/e1584.png
Binary file added assets/emojies/e1585.png
Binary file added assets/emojies/e1586.png
Binary file added assets/emojies/e1587.png
Binary file added assets/emojies/e1588.png
Binary file added assets/emojies/e1589.png
Binary file added assets/emojies/e1590.png
Binary file added assets/emojies/e1591.png
Binary file added assets/emojies/e1592.png
Binary file added assets/emojies/e1593.png
Binary file added assets/emojies/e1594.png
Binary file added assets/emojies/e1595.png
Binary file added assets/emojies/e1596.png
Binary file added assets/emojies/e1597.png
Binary file added assets/emojies/e1598.png
Binary file added assets/emojies/e1599.png
Binary file added assets/emojies/e1600.png
Binary file added assets/emojies/e1601.png
Binary file added assets/emojies/e1602.png
Binary file added assets/emojies/e1603.png
Binary file added assets/emojies/e1604.png
Binary file added assets/emojies/e1605.png
Binary file added assets/emojies/e1606.png
Binary file added assets/emojies/e1607.png
Binary file added assets/emojies/e1608.png
Binary file added assets/emojies/e1609.png
Binary file added assets/emojies/e1610.png
Binary file added assets/emojies/e1611.png
Binary file added assets/emojies/e1612.png
Binary file added assets/emojies/e1613.png
Binary file added assets/emojies/e1614.png
Binary file added assets/emojies/e1615.png
Binary file added assets/emojies/e1616.png
Binary file added assets/emojies/e1617.png
Binary file added assets/emojies/e1618.png
Binary file added assets/emojies/e1619.png
Binary file added assets/emojies/e1620.png
Binary file added assets/emojies/e1621.png
Binary file added assets/emojies/e1622.png
Binary file added assets/emojies/e1623.png
Binary file added assets/emojies/e1624.png
Binary file added assets/emojies/e1625.png
Binary file added assets/emojies/e1626.png
Binary file added assets/emojies/e1627.png
Binary file added assets/emojies/e1628.png
Binary file added assets/emojies/e1629.png
Binary file added assets/emojies/e1630.png
Binary file added assets/emojies/e1631.png
Binary file added assets/emojies/e1632.png
Binary file added assets/emojies/e1633.png
Binary file added assets/emojies/e1634.png
Binary file added assets/emojies/e1635.png
Binary file added assets/emojies/e1636.png
Binary file added assets/emojies/e1637.png
Binary file added assets/emojies/e1638.png
Binary file added assets/emojies/e1639.png
Binary file added assets/emojies/e1640.png
Binary file added assets/emojies/e1641.png
Binary file added assets/emojies/e1642.png
Binary file added assets/emojies/e1643.png
Binary file added assets/emojies/e1644.png
Binary file added assets/emojies/e1645.png
Binary file added assets/emojies/e1646.png
Binary file added assets/emojies/e1647.png
Binary file added assets/emojies/e1648.png
Binary file added assets/emojies/e1649.png
Binary file added assets/emojies/e1650.png
Binary file added assets/emojies/e1651.png
Binary file added assets/emojies/e1652.png
Binary file added assets/emojies/e1653.png
Binary file added assets/emojies/e1654.png
Binary file added assets/emojies/e1655.png
Binary file added assets/emojies/e1656.png
Binary file added assets/emojies/e1657.png
Binary file added assets/emojies/e1658.png
Binary file added assets/emojies/e1659.png
Binary file added assets/emojies/e1660.png
Binary file added assets/emojies/e1661.png
Binary file added assets/emojies/e1662.png
Binary file added assets/emojies/e1663.png
Binary file added assets/emojies/e1664.png
Binary file added assets/emojies/e1665.png
Binary file added assets/emojies/e1666.png
Binary file added assets/emojies/e1757.png
Binary file added assets/emojies/e1758.png
Binary file added assets/emojies/e1759.png
Binary file added assets/emojies/e1760.png
Binary file added assets/emojies/e1761.png
Binary file added assets/emojies/e1762.png
Binary file added assets/emojies/e1763.png
Binary file added assets/emojies/e1764.png
Binary file added assets/emojies/e1765.png
Binary file added assets/emojies/e1766.png
Binary file added assets/emojies/e1767.png
Binary file added assets/emojies/e1768.png
Binary file added assets/emojies/e1769.png
Binary file added assets/emojies/e1779.png
Binary file added assets/emojies/e1780.png
Binary file added assets/emojies/e1781.png
Binary file added assets/emojies/e1782.png
Binary file added assets/emojies/e1783.png
Binary file added assets/emojies/e1784.png
Binary file added assets/emojies/e1785.png
Binary file added assets/emojies/e1791.png
Binary file added assets/emojies/e1792.png
Binary file added assets/emojies/e1793.png
Binary file added assets/emojies/e1794.png
Binary file added assets/emojies/e1795.png
Binary file added assets/emojies/e1796.png
Binary file added assets/emojies/e1799.png
Binary file added assets/emojies/e1819.png
Binary file added assets/emojies/e1820.png
Binary file added assets/emojies/e1821.png
Binary file added assets/emojies/e1822.png
Binary file added assets/emojies/e1823.png
Binary file added assets/emojies/e1824.png
Binary file added assets/fonts/angkor/Angkor-Regular.ttf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added assets/fonts/lato/Lato-Regular.ttf
Binary file not shown.
Binary file added assets/fonts/lora/Lora-Medium.ttf
Binary file not shown.
Binary file added assets/fonts/lora/Lora-Regular.ttf
Binary file not shown.
Binary file added assets/fonts/madimiOne/MadimiOne-Regular.ttf
Binary file not shown.
Binary file not shown.
Binary file added assets/fonts/montserrat/Montserrat-Medium.ttf
Binary file not shown.
Binary file added assets/fonts/montserrat/Montserrat-Regular.ttf
Binary file not shown.
Binary file added assets/fonts/oswald/Oswald-Medium.ttf
Binary file not shown.
Binary file added assets/fonts/oswald/Oswald-Regular.ttf
Binary file not shown.
Binary file added assets/fonts/pacifico/Pacifico-Regular.ttf
Binary file not shown.
Binary file added assets/fonts/raleway/Raleway-Medium.ttf
Binary file not shown.
Binary file added assets/fonts/raleway/Raleway-Regular.ttf
Binary file not shown.
Binary file added assets/fonts/roboto/Roboto-Medium.ttf
Binary file not shown.
Binary file added assets/fonts/roboto/Roboto-Regular.ttf
Binary file not shown.
Binary file added assets/images/01_Cuppy_smile.webp
Binary file not shown.
Binary file added assets/images/02_Cuppy_lol.webp
Binary file not shown.
Binary file added assets/images/03_Cuppy_rofl.webp
Binary file not shown.
Binary file added assets/images/04_Cuppy_sad.webp
Binary file not shown.
Binary file added assets/images/05_Cuppy_cry.webp
Binary file not shown.
Binary file added assets/images/06_Cuppy_love.webp
Binary file not shown.
Binary file added assets/images/07_Cuppy_hate.webp
Binary file not shown.
Binary file added assets/images/08_Cuppy_lovewithmug.webp
Binary file not shown.
Binary file added assets/images/09_Cuppy_lovewithcookie.webp
Binary file not shown.
Binary file added assets/images/10_Cuppy_hmm.webp
Binary file not shown.
Binary file added assets/images/11_Cuppy_upset.webp
Binary file not shown.
Binary file added assets/images/12_Cuppy_angry.webp
Binary file not shown.
Binary file added assets/images/13_Cuppy_curious.webp
Binary file not shown.
Binary file added assets/images/14_Cuppy_weird.webp
Binary file not shown.
Binary file added assets/images/15_Cuppy_bluescreen.webp
Binary file not shown.
Binary file added assets/images/16_Cuppy_angry.webp
Binary file not shown.
Binary file added assets/images/17_Cuppy_tired.webp
Binary file not shown.
Binary file added assets/images/18_Cuppy_workhard.webp
Binary file not shown.
Binary file added assets/images/19_Cuppy_shine.webp
Binary file not shown.
Binary file added assets/images/20_Cuppy_disgusting.webp
Binary file not shown.
Binary file added assets/images/21_Cuppy_hi.webp
Binary file not shown.
Binary file added assets/images/22_Cuppy_bye.webp
Binary file not shown.
Binary file added assets/images/23_Cuppy_greentea.webp
Binary file not shown.
Binary file added assets/images/24_Cuppy_phone.webp
Binary file not shown.
Binary file added assets/images/25_Cuppy_battery.webp
Binary file not shown.
Binary file added assets/images/tray_Cuppy.png
123 changes: 123 additions & 0 deletions example/example.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@

import 'dart:io';

import 'package:file_picker/file_picker.dart';
import 'package:flutter/material.dart';
import 'package:flutter_story_editor/flutter_story_editor.dart';
import 'package:flutter_story_editor/src/controller/controller.dart';

import 'package:path/path.dart' as path;

class FlutterStoryEditorExample extends StatefulWidget {
// final User? user;
const FlutterStoryEditorExample({super.key});

@override
State<FlutterStoryEditorExample> createState() => _FlutterStoryEditorExampleState();
}

class _FlutterStoryEditorExampleState extends State<FlutterStoryEditorExample> with SingleTickerProviderStateMixin {

FlutterStoryEditorController controller = FlutterStoryEditorController();

final TextEditingController _captionController = TextEditingController();



List<File>? _selectedMedia;

List<String>? _mediaTypes; // To store the type of each selected file

Future<void> selectMedia() async {
setState(() {
_selectedMedia = null;
_mediaTypes = null;
});

try {
final result = await FilePicker.platform.pickFiles(
type: FileType.media,
allowMultiple: true,
);
if (result != null) {
_selectedMedia = result.files.map((file) => File(file.path!)).toList();

// Initialize the media types list
_mediaTypes = List<String>.filled(_selectedMedia!.length, '');

// Determine the type of each selected file
for (int i = 0; i < _selectedMedia!.length; i++) {
String extension = path.extension(_selectedMedia![i].path)
.toLowerCase();
if (extension == '.jpg' || extension == '.jpeg' ||
extension == '.png') {
_mediaTypes![i] = 'image';
} else if (extension == '.mp4' || extension == '.mov' ||
extension == '.avi') {
_mediaTypes![i] = 'video';
}
}

setState(() {});
} else {
print("No file is selected.");
}
} catch (e) {
print("Error while picking file: $e");
}
}


@override
Widget build(BuildContext context) {
return Scaffold(
body: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [

Center(
child: IconButton(onPressed: () {


selectMedia().then(
(value) {

if (_selectedMedia != null && _selectedMedia!.isNotEmpty) {
showModalBottomSheet(
isScrollControlled: true,
isDismissible: false,
enableDrag: false,
context: context,
builder: (context) {

return FlutterStoryEditor(
controller: controller,
captionController: _captionController,
selectedFiles: _selectedMedia,
onSaveClickListener: (files) {
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) => ImagesPage(files: files),
// ),
// );
}
);
},
);
}

},
);
}, icon: const Icon(Icons.upload, size: 50,)),
),


const SizedBox(height: 10),
const Text("Pick Files & Play with them")

],
),
);
}
}
Loading

0 comments on commit ee8a271

Please sign in to comment.