diff --git a/CHANGELOG.md b/CHANGELOG.md index 978dd2cc..4edadd9f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.2.0 + +* Update plugin versions + ## 1.1.3 * Changing `path` version to `1.8.0` (latest is `1.8.1`) because it creates a conflict with `flutter_test` as it uses the older version diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index 3f46a61f..c082d02c 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -26,7 +26,7 @@ apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { - compileSdkVersion 31 + compileSdkVersion 33 sourceSets { main.java.srcDirs += 'src/main/kotlin' @@ -40,7 +40,7 @@ android { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.example.example" minSdkVersion 16 - targetSdkVersion 31 + targetSdkVersion 33 versionCode flutterVersionCode.toInteger() versionName flutterVersionName testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" diff --git a/example/ios/Flutter/AppFrameworkInfo.plist b/example/ios/Flutter/AppFrameworkInfo.plist index f2872cf4..4f8d4d24 100644 --- a/example/ios/Flutter/AppFrameworkInfo.plist +++ b/example/ios/Flutter/AppFrameworkInfo.plist @@ -21,6 +21,6 @@ CFBundleVersion 1.0 MinimumOSVersion - 9.0 + 11.0 diff --git a/example/ios/Podfile b/example/ios/Podfile index c53c4a9c..313ea4a1 100644 --- a/example/ios/Podfile +++ b/example/ios/Podfile @@ -1,5 +1,5 @@ # Uncomment this line to define a global platform for your project -platform :ios, '10' +platform :ios, '11.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index b1b0b7a6..0c3aeb12 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -1,12 +1,12 @@ PODS: - - DKImagePickerController/Core (4.3.2): + - DKImagePickerController/Core (4.3.4): - DKImagePickerController/ImageDataManager - DKImagePickerController/Resource - - DKImagePickerController/ImageDataManager (4.3.2) - - DKImagePickerController/PhotoGallery (4.3.2): + - DKImagePickerController/ImageDataManager (4.3.4) + - DKImagePickerController/PhotoGallery (4.3.4): - DKImagePickerController/Core - DKPhotoGallery - - DKImagePickerController/Resource (4.3.2) + - DKImagePickerController/Resource (4.3.4) - DKPhotoGallery (0.0.17): - DKPhotoGallery/Core (= 0.0.17) - DKPhotoGallery/Model (= 0.0.17) @@ -30,32 +30,32 @@ PODS: - DKPhotoGallery/Resource (0.0.17): - SDWebImage - SwiftyGif - - ffmpeg-kit-ios-https (4.5.1.LTS) - - ffmpeg_kit_flutter (4.5.1.LTS): - - ffmpeg_kit_flutter/https-lts (= 4.5.1.LTS) + - ffmpeg-kit-ios-https (5.1.LTS) + - ffmpeg_kit_flutter (5.1.0.LTS): + - ffmpeg_kit_flutter/https-lts (= 5.1.0.LTS) - Flutter - - ffmpeg_kit_flutter/https-lts (4.5.1.LTS): - - ffmpeg-kit-ios-https (= 4.5.1.LTS) + - ffmpeg_kit_flutter/https-lts (5.1.0.LTS): + - ffmpeg-kit-ios-https (= 5.1.LTS) - Flutter - file_picker (0.0.1): - DKImagePickerController/PhotoGallery - Flutter - Flutter (1.0.0) - - libwebp (1.1.0): - - libwebp/demux (= 1.1.0) - - libwebp/mux (= 1.1.0) - - libwebp/webp (= 1.1.0) - - libwebp/demux (1.1.0): + - libwebp (1.2.3): + - libwebp/demux (= 1.2.3) + - libwebp/mux (= 1.2.3) + - libwebp/webp (= 1.2.3) + - libwebp/demux (1.2.3): - libwebp/webp - - libwebp/mux (1.1.0): + - libwebp/mux (1.2.3): - libwebp/demux - - libwebp/webp (1.1.0) + - libwebp/webp (1.2.3) - path_provider_ios (0.0.1): - Flutter - - SDWebImage (5.10.2): - - SDWebImage/Core (= 5.10.2) - - SDWebImage/Core (5.10.2) - - SwiftyGif (5.3.0) + - SDWebImage (5.13.4): + - SDWebImage/Core (= 5.13.4) + - SDWebImage/Core (5.13.4) + - SwiftyGif (5.4.3) - video_player_avfoundation (0.0.1): - Flutter - video_thumbnail (0.0.1): @@ -94,19 +94,19 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/video_thumbnail/ios" SPEC CHECKSUMS: - DKImagePickerController: b5eb7f7a388e4643264105d648d01f727110fc3d + DKImagePickerController: b512c28220a2b8ac7419f21c491fc8534b7601ac DKPhotoGallery: fdfad5125a9fdda9cc57df834d49df790dbb4179 - ffmpeg-kit-ios-https: c95f1d49599efd796a7cfb433f4500a7c953cc9c - ffmpeg_kit_flutter: 7429364786c032a7825e7882819cca6c65449a81 - file_picker: 3e6c3790de664ccf9b882732d9db5eaf6b8d4eb1 - Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a - libwebp: 946cb3063cea9236285f7e9a8505d806d30e07f3 + ffmpeg-kit-ios-https: 9e50ffa7eaa6272a0021829e054ef241f2ecffb2 + ffmpeg_kit_flutter: fb5bee3a6038231463ee99e30f97a5763e0ae40f + file_picker: 817ab1d8cd2da9d2da412a417162deee3500fc95 + Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 + libwebp: 60305b2e989864154bd9be3d772730f08fc6a59c path_provider_ios: 14f3d2fd28c4fdb42f44e0f751d12861c43cee02 - SDWebImage: b969dcfc02c40a5da71eac0b03b8f1a0c794a86f - SwiftyGif: e466e86c660d343357ab944a819a101c4127cb40 + SDWebImage: e5cc87bf736e60f49592f307bdf9e157189298a3 + SwiftyGif: 6c3eafd0ce693cad58bb63d2b2fb9bacb8552780 video_player_avfoundation: e489aac24ef5cf7af82702979ed16f2a5ef84cff video_thumbnail: c4e2a3c539e247d4de13cd545344fd2d26ffafd1 -PODFILE CHECKSUM: cca541ad442be8848bcda22bd1ae3f16f7a47a29 +PODFILE CHECKSUM: 7368163408c647b7eb699d0d788ba6718e18fb8d -COCOAPODS: 1.11.2 +COCOAPODS: 1.11.3 diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj index 84e20a70..35cf6340 100644 --- a/example/ios/Runner.xcodeproj/project.pbxproj +++ b/example/ios/Runner.xcodeproj/project.pbxproj @@ -382,7 +382,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -399,7 +399,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = WJ48SZA38U; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -407,12 +407,13 @@ "$(PROJECT_DIR)/Flutter", ); INFOPLIST_FILE = Runner/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 14.5; + IPHONEOS_DEPLOYMENT_TARGET = 15.5; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", ); + MARKETING_VERSION = 1.0.0; PRODUCT_BUNDLE_IDENTIFIER = com.souvikbiswas.example; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -469,7 +470,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -518,7 +519,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -536,7 +537,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = WJ48SZA38U; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -544,12 +545,13 @@ "$(PROJECT_DIR)/Flutter", ); INFOPLIST_FILE = Runner/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 14.5; + IPHONEOS_DEPLOYMENT_TARGET = 15.5; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", ); + MARKETING_VERSION = 1.0.0; PRODUCT_BUNDLE_IDENTIFIER = com.souvikbiswas.example; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -568,7 +570,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = WJ48SZA38U; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -576,12 +578,13 @@ "$(PROJECT_DIR)/Flutter", ); INFOPLIST_FILE = Runner/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 14.5; + IPHONEOS_DEPLOYMENT_TARGET = 15.5; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", ); + MARKETING_VERSION = 1.0.0; PRODUCT_BUNDLE_IDENTIFIER = com.souvikbiswas.example; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/example/ios/Runner/Info.plist b/example/ios/Runner/Info.plist index a2d386ae..03b3114a 100644 --- a/example/ios/Runner/Info.plist +++ b/example/ios/Runner/Info.plist @@ -2,6 +2,8 @@ + CADisableMinimumFrameDurationOnPhone + CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleExecutable diff --git a/example/lib/preview.dart b/example/lib/preview.dart index 7dfce1fa..feaf26d0 100644 --- a/example/lib/preview.dart +++ b/example/lib/preview.dart @@ -9,7 +9,7 @@ class Preview extends StatefulWidget { const Preview(this.outputVideoPath, {Key? key}) : super(key: key); @override - _PreviewState createState() => _PreviewState(); + State createState() => _PreviewState(); } class _PreviewState extends State { diff --git a/example/lib/trimmer_view.dart b/example/lib/trimmer_view.dart index 9c1bead8..1fcf6c09 100644 --- a/example/lib/trimmer_view.dart +++ b/example/lib/trimmer_view.dart @@ -9,7 +9,7 @@ class TrimmerView extends StatefulWidget { const TrimmerView(this.file, {Key? key}) : super(key: key); @override - _TrimmerViewState createState() => _TrimmerViewState(); + State createState() => _TrimmerViewState(); } class _TrimmerViewState extends State { diff --git a/example/pubspec.lock b/example/pubspec.lock index f728e7bf..d4346c7e 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -7,7 +7,7 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.2.1" clock: dependency: transitive description: @@ -21,7 +21,7 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.16.0" csslib: dependency: transitive description: @@ -35,14 +35,14 @@ packages: name: ffi url: "https://pub.dartlang.org" source: hosted - version: "1.1.2" + version: "2.0.1" ffmpeg_kit_flutter: dependency: transitive description: name: ffmpeg_kit_flutter url: "https://pub.dartlang.org" source: hosted - version: "4.5.1-LTS" + version: "5.1.0-LTS" ffmpeg_kit_flutter_platform_interface: dependency: transitive description: @@ -63,7 +63,7 @@ packages: name: file_picker url: "https://pub.dartlang.org" source: hosted - version: "4.5.1" + version: "5.2.2" flutter: dependency: "direct main" description: flutter @@ -75,14 +75,14 @@ packages: name: flutter_lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.0.1" flutter_plugin_android_lifecycle: dependency: transitive description: name: flutter_plugin_android_lifecycle url: "https://pub.dartlang.org" source: hosted - version: "2.0.5" + version: "2.0.7" flutter_web_plugins: dependency: transitive description: flutter @@ -108,42 +108,42 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.3" + version: "0.6.4" lints: dependency: transitive description: name: lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "2.0.1" material_color_utilities: dependency: transitive description: name: material_color_utilities url: "https://pub.dartlang.org" source: hosted - version: "0.1.3" + version: "0.1.5" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.7.0" + version: "1.8.0" path: dependency: transitive description: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.8.2" path_provider: dependency: transitive description: name: path_provider url: "https://pub.dartlang.org" source: hosted - version: "2.0.9" + version: "2.0.11" path_provider_android: dependency: transitive description: @@ -164,7 +164,7 @@ packages: name: path_provider_linux url: "https://pub.dartlang.org" source: hosted - version: "2.1.5" + version: "2.1.7" path_provider_macos: dependency: transitive description: @@ -185,7 +185,7 @@ packages: name: path_provider_windows url: "https://pub.dartlang.org" source: hosted - version: "2.0.5" + version: "2.1.3" platform: dependency: transitive description: @@ -226,34 +226,27 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.2.0" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.1.2" video_player: dependency: "direct main" description: name: video_player url: "https://pub.dartlang.org" source: hosted - version: "2.4.0" + version: "2.4.7" video_player_android: dependency: transitive description: name: video_player_android url: "https://pub.dartlang.org" source: hosted - version: "2.3.0" + version: "2.3.9" video_player_avfoundation: dependency: transitive description: @@ -267,7 +260,7 @@ packages: name: video_player_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "5.1.0" + version: "5.1.4" video_player_web: dependency: transitive description: @@ -281,21 +274,21 @@ packages: name: video_thumbnail url: "https://pub.dartlang.org" source: hosted - version: "0.5.0" + version: "0.5.3" video_trimmer: dependency: "direct main" description: path: ".." relative: true source: path - version: "1.1.3" + version: "1.2.0" win32: dependency: transitive description: name: win32 url: "https://pub.dartlang.org" source: hosted - version: "2.4.1" + version: "3.0.1" xdg_directories: dependency: transitive description: @@ -304,5 +297,5 @@ packages: source: hosted version: "0.2.0+1" sdks: - dart: ">=2.16.2 <3.0.0" - flutter: ">=2.10.0" + dart: ">=2.18.2 <3.0.0" + flutter: ">=3.0.0" diff --git a/example/pubspec.yaml b/example/pubspec.yaml index e5e254b6..36ff36cc 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -6,7 +6,7 @@ version: 1.0.0+1 publish_to: none environment: - sdk: ">=2.16.2 <3.0.0" + sdk: ">=2.18.2 <3.0.0" dependencies: flutter: @@ -14,11 +14,11 @@ dependencies: video_trimmer: path: ../ - video_player: ^2.4.0 - file_picker: ^4.5.1 + video_player: ^2.4.7 + file_picker: ^5.2.2 dev_dependencies: - flutter_lints: ^1.0.4 + flutter_lints: ^2.0.1 flutter: uses-material-design: true diff --git a/lib/src/thumbnail_viewer.dart b/lib/src/thumbnail_viewer.dart index e9a14d4a..a916c0a3 100644 --- a/lib/src/thumbnail_viewer.dart +++ b/lib/src/thumbnail_viewer.dart @@ -25,34 +25,34 @@ class ThumbnailViewer extends StatelessWidget { }) : super(key: key); Stream> generateThumbnail() async* { - final String _videoPath = videoFile.path; + final String videoPath = videoFile.path; - double _eachPart = videoDuration / numberOfThumbnails; + double eachPart = videoDuration / numberOfThumbnails; - List _byteList = []; + List byteList = []; // the cache of last thumbnail - Uint8List? _lastBytes; + Uint8List? lastBytes; for (int i = 1; i <= numberOfThumbnails; i++) { - Uint8List? _bytes; - _bytes = await VideoThumbnail.thumbnailData( - video: _videoPath, + Uint8List? bytes; + bytes = await VideoThumbnail.thumbnailData( + video: videoPath, imageFormat: ImageFormat.JPEG, - timeMs: (_eachPart * i).toInt(), + timeMs: (eachPart * i).toInt(), quality: quality, ); // if current thumbnail is null use the last thumbnail - if (_bytes != null) { - _lastBytes = _bytes; + if (bytes != null) { + lastBytes = bytes; } else { - _bytes = _lastBytes; + bytes = lastBytes; } - _byteList.add(_bytes); + byteList.add(bytes); - yield _byteList; + yield byteList; } } @@ -62,16 +62,16 @@ class ThumbnailViewer extends StatelessWidget { stream: generateThumbnail(), builder: (context, snapshot) { if (snapshot.hasData) { - List _imageBytes = snapshot.data!; + List imageBytes = snapshot.data!; return ListView.builder( scrollDirection: Axis.horizontal, - itemCount: _imageBytes.length, + itemCount: imageBytes.length, itemBuilder: (context, index) { return SizedBox( height: thumbnailHeight, width: thumbnailHeight, child: Image( - image: MemoryImage(_imageBytes[index]!), + image: MemoryImage(imageBytes[index]!), fit: fit, ), ); diff --git a/lib/src/trim_editor.dart b/lib/src/trim_editor.dart index d93c1d6d..84bae2c7 100644 --- a/lib/src/trim_editor.dart +++ b/lib/src/trim_editor.dart @@ -194,7 +194,7 @@ class TrimEditor extends StatefulWidget { }) : super(key: key); @override - _TrimEditorState createState() => _TrimEditorState(); + State createState() => _TrimEditorState(); } class _TrimEditorState extends State with TickerProviderStateMixin { @@ -346,7 +346,7 @@ class _TrimEditorState extends State with TickerProviderStateMixin { videoPlayerController.setVolume(1.0); _videoDuration = videoPlayerController.value.duration.inMilliseconds; - final ThumbnailViewer _thumbnailWidget = ThumbnailViewer( + final ThumbnailViewer thumbnailWidget = ThumbnailViewer( videoFile: _videoFile!, videoDuration: _videoDuration, fit: widget.fit, @@ -354,7 +354,7 @@ class _TrimEditorState extends State with TickerProviderStateMixin { numberOfThumbnails: _numberOfThumbnails, quality: widget.thumbnailQuality, ); - thumbnailWidget = _thumbnailWidget; + this.thumbnailWidget = thumbnailWidget; } } diff --git a/lib/src/trimmer.dart b/lib/src/trimmer.dart index 64a5fbe7..dab171e4 100644 --- a/lib/src/trimmer.dart +++ b/lib/src/trimmer.dart @@ -52,40 +52,40 @@ class Trimmer { String folderName, StorageDir? storageDir, ) async { - Directory? _directory; + Directory? directory; if (storageDir == null) { - _directory = await getApplicationDocumentsDirectory(); + directory = await getApplicationDocumentsDirectory(); } else { switch (storageDir.toString()) { case 'temporaryDirectory': - _directory = await getTemporaryDirectory(); + directory = await getTemporaryDirectory(); break; case 'applicationDocumentsDirectory': - _directory = await getApplicationDocumentsDirectory(); + directory = await getApplicationDocumentsDirectory(); break; case 'externalStorageDirectory': - _directory = await getExternalStorageDirectory(); + directory = await getExternalStorageDirectory(); break; } } // Directory + folder name - final Directory _directoryFolder = - Directory('${_directory!.path}/$folderName/'); + final Directory directoryFolder = + Directory('${directory!.path}/$folderName/'); - if (await _directoryFolder.exists()) { + if (await directoryFolder.exists()) { // If folder already exists return path debugPrint('Exists'); - return _directoryFolder.path; + return directoryFolder.path; } else { debugPrint('Creating'); // If folder does not exists create folder and then return its path - final Directory _directoryNewFolder = - await _directoryFolder.create(recursive: true); - return _directoryNewFolder.path; + final Directory directoryNewFolder = + await directoryFolder.create(recursive: true); + return directoryNewFolder.path; } } @@ -173,10 +173,10 @@ class Trimmer { String? videoFileName, StorageDir? storageDir, }) async { - final String _videoPath = currentVideoFile!.path; - final String _videoName = basename(_videoPath).split('.')[0]; + final String videoPath = currentVideoFile!.path; + final String videoName = basename(videoPath).split('.')[0]; - String _command; + String command; // Formatting Date and Time String dateTime = DateFormat.yMMMd() @@ -186,8 +186,8 @@ class Trimmer { .toString(); // String _resultString; - String _outputPath; - String? _outputFormatString; + String outputPath; + String? outputFormatString; String formattedDateTime = dateTime.replaceAll(' ', ''); debugPrint("DateTime: $dateTime"); @@ -195,7 +195,7 @@ class Trimmer { videoFolderName ??= "Trimmer"; - videoFileName ??= "${_videoName}_trimmed:$formattedDateTime"; + videoFileName ??= "${videoName}_trimmed:$formattedDateTime"; videoFileName = videoFileName.replaceAll(' ', '_'); @@ -216,38 +216,38 @@ class Trimmer { if (outputFormat == null) { outputFormat = FileFormat.mp4; - _outputFormatString = outputFormat.toString(); - debugPrint('OUTPUT: $_outputFormatString'); + outputFormatString = outputFormat.toString(); + debugPrint('OUTPUT: $outputFormatString'); } else { - _outputFormatString = outputFormat.toString(); + outputFormatString = outputFormat.toString(); } - String _trimLengthCommand = - ' -ss $startPoint -i "$_videoPath" -t ${endPoint - startPoint} -avoid_negative_ts make_zero '; + String trimLengthCommand = + ' -ss $startPoint -i "$videoPath" -t ${endPoint - startPoint} -avoid_negative_ts make_zero '; if (ffmpegCommand == null) { - _command = '$_trimLengthCommand -c:a copy '; + command = '$trimLengthCommand -c:a copy '; if (!applyVideoEncoding) { - _command += '-c:v copy '; + command += '-c:v copy '; } if (outputFormat == FileFormat.gif) { fpsGIF ??= 10; scaleGIF ??= 480; - _command = - '$_trimLengthCommand -vf "fps=$fpsGIF,scale=$scaleGIF:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop 0 '; + command = + '$trimLengthCommand -vf "fps=$fpsGIF,scale=$scaleGIF:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop 0 '; } } else { - _command = '$_trimLengthCommand $ffmpegCommand '; - _outputFormatString = customVideoFormat; + command = '$trimLengthCommand $ffmpegCommand '; + outputFormatString = customVideoFormat; } - _outputPath = '$path$videoFileName$_outputFormatString'; + outputPath = '$path$videoFileName$outputFormatString'; - _command += '"$_outputPath"'; + command += '"$outputPath"'; - FFmpegKit.executeAsync(_command, (session) async { + FFmpegKit.executeAsync(command, (session) async { final state = FFmpegKitConfig.sessionStateToString(await session.getState()); final returnCode = await session.getReturnCode(); @@ -256,8 +256,8 @@ class Trimmer { if (ReturnCode.isSuccess(returnCode)) { debugPrint("FFmpeg processing completed successfully."); - debugPrint('Video successfuly saved'); - onSave(_outputPath); + debugPrint('Video successfully saved'); + onSave(outputPath); } else { debugPrint("FFmpeg processing failed."); debugPrint('Couldn\'t save the video'); diff --git a/lib/src/video_viewer.dart b/lib/src/video_viewer.dart index 9ab37e77..53db228b 100644 --- a/lib/src/video_viewer.dart +++ b/lib/src/video_viewer.dart @@ -44,7 +44,7 @@ class VideoViewer extends StatefulWidget { }) : super(key: key); @override - _VideoViewerState createState() => _VideoViewerState(); + State createState() => _VideoViewerState(); } class _VideoViewerState extends State { @@ -66,15 +66,15 @@ class _VideoViewerState extends State { @override Widget build(BuildContext context) { - final _controller = videoPlayerController; - return _controller == null + final controller = videoPlayerController; + return controller == null ? Container() : Padding( padding: const EdgeInsets.all(0.0), child: Center( child: AspectRatio( - aspectRatio: _controller.value.aspectRatio, - child: _controller.value.isInitialized + aspectRatio: controller.value.aspectRatio, + child: controller.value.isInitialized ? Container( foregroundDecoration: BoxDecoration( border: Border.all( @@ -82,7 +82,7 @@ class _VideoViewerState extends State { color: widget.borderColor, ), ), - child: VideoPlayer(_controller), + child: VideoPlayer(controller), ) : const Center( child: CircularProgressIndicator( diff --git a/pubspec.lock b/pubspec.lock index cd776d05..e7ef97ed 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -7,7 +7,7 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.2.1" clock: dependency: transitive description: @@ -21,7 +21,7 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.16.0" csslib: dependency: transitive description: @@ -42,7 +42,7 @@ packages: name: ffmpeg_kit_flutter url: "https://pub.dartlang.org" source: hosted - version: "4.5.1-LTS" + version: "5.1.0-LTS" ffmpeg_kit_flutter_platform_interface: dependency: transitive description: @@ -68,7 +68,7 @@ packages: name: flutter_lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.0.1" flutter_web_plugins: dependency: transitive description: flutter @@ -94,42 +94,42 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.3" + version: "0.6.4" lints: dependency: "direct dev" description: name: lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "2.0.1" material_color_utilities: dependency: transitive description: name: material_color_utilities url: "https://pub.dartlang.org" source: hosted - version: "0.1.3" + version: "0.1.5" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.7.0" + version: "1.8.0" path: dependency: "direct main" description: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.8.2" path_provider: dependency: "direct main" description: name: path_provider url: "https://pub.dartlang.org" source: hosted - version: "2.0.9" + version: "2.0.11" path_provider_android: dependency: transitive description: @@ -212,34 +212,27 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.2.0" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.1.2" video_player: dependency: "direct main" description: name: video_player url: "https://pub.dartlang.org" source: hosted - version: "2.4.0" + version: "2.4.7" video_player_android: dependency: transitive description: name: video_player_android url: "https://pub.dartlang.org" source: hosted - version: "2.3.0" + version: "2.3.9" video_player_avfoundation: dependency: transitive description: @@ -253,7 +246,7 @@ packages: name: video_player_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "5.1.0" + version: "5.1.4" video_player_web: dependency: transitive description: @@ -267,7 +260,7 @@ packages: name: video_thumbnail url: "https://pub.dartlang.org" source: hosted - version: "0.5.0" + version: "0.5.3" win32: dependency: transitive description: @@ -283,5 +276,5 @@ packages: source: hosted version: "0.2.0+1" sdks: - dart: ">=2.16.2 <3.0.0" + dart: ">=2.18.2 <3.0.0" flutter: ">=2.10.0" diff --git a/pubspec.yaml b/pubspec.yaml index 58bb1aa4..229e0dd6 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,24 +1,24 @@ name: video_trimmer description: A Flutter package for trimming videos. This supports retrieving, trimming, and storage of trimmed video files to the file system. -version: 1.1.3 +version: 1.2.0 homepage: https://github.com/sbis04/video_trimmer environment: - sdk: '>=2.16.2 <3.0.0' + sdk: '>=2.18.2 <3.0.0' dependencies: flutter: sdk: flutter - video_player: ^2.4.0 - ffmpeg_kit_flutter: ^4.5.1-LTS - video_thumbnail: ^0.5.0 - path_provider: ^2.0.9 + video_player: ^2.4.7 + ffmpeg_kit_flutter: ^5.1.0-LTS + video_thumbnail: ^0.5.3 + path_provider: ^2.0.11 intl: ^0.17.0 - path: ^1.8.0 + path: ^1.8.2 dev_dependencies: - flutter_lints: ^1.0.4 - lints: ^1.0.1 + flutter_lints: ^2.0.1 + lints: ^2.0.1 flutter: