Skip to content

Commit

Permalink
Merge pull request #245 from takenet/release/0.0.95
Browse files Browse the repository at this point in the history
[Release] 0.0.95
  • Loading branch information
mpamaro authored Jan 4, 2024
2 parents 7b04b18 + d7159d9 commit 381796a
Show file tree
Hide file tree
Showing 8 changed files with 151 additions and 45 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.0.95

- [DSFileService] Fixed ```getExtensionFromMimeType``` method to get mime type based on RegEx.

## 0.0.94

- [DSExpandedImage] Centered the circular progress loading.
Expand Down
26 changes: 15 additions & 11 deletions lib/src/services/ds_file.service.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'dart:io';

import 'package:dio/dio.dart';
import 'package:mime/mime.dart';
import 'package:open_filex/open_filex.dart';
import 'package:path/path.dart' as path_utils;
import 'package:path_provider/path_provider.dart';
Expand Down Expand Up @@ -79,17 +78,19 @@ abstract class DSFileService {
final hasExtension = path_utils.extension(savedFilePath).isNotEmpty;

if (!hasExtension) {
final newExtension = getFileExtensionFromMime(
response.headers.map['content-type']?.first,
);
final mime = response.headers.map['content-type']?.first;

if (mime?.isNotEmpty ?? false) {
final newExtension = getExtensionFromMimeType(mime!);

if (newExtension.isNotEmpty) {
final filename = savedFilePath.substring(0);
if (newExtension.isNotEmpty) {
final filename = savedFilePath.substring(0);

final newFilePath = '$filename.$newExtension';
final newFilePath = '$filename.$newExtension';

File(savedFilePath).renameSync(newFilePath);
savedFilePath = newFilePath;
File(savedFilePath).renameSync(newFilePath);
savedFilePath = newFilePath;
}
}
}

Expand All @@ -102,9 +103,12 @@ abstract class DSFileService {
return null;
}

static String getFileExtensionFromMime(String? mimeType) {
static String getExtensionFromMimeType(final String mimeType) {
return mimeType == 'application/vnd.ms-powerpoint'
? 'ppt'
: extensionFromMime(mimeType ?? '');
: RegExp(r'((?<=\/)[a-zA-Z0-9]+)')
.firstMatch(mimeType)?[0]
?.toLowerCase() ??
'';
}
}
2 changes: 1 addition & 1 deletion lib/src/widgets/utils/ds_card.widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ class DSCard extends StatelessWidget {
replyContent: replyContent,
size: size,
filename: media.title ??
'${media.uri.hashCode}.${DSFileService.getFileExtensionFromMime(media.type)}',
'${media.uri.hashCode}.${DSFileService.getExtensionFromMimeType(media.type)}',
borderRadius: borderRadius,
style: style,
shouldAuthenticate: shouldAuthenticate,
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: blip_ds
description: Blip Design System for Flutter.
version: 0.0.94
version: 0.0.95
homepage: https://github.com/takenet/blip-ds-flutter#readme
repository: https://github.com/takenet/blip-ds-flutter

Expand Down
92 changes: 64 additions & 28 deletions sample/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,56 +9,83 @@ PODS:
- ffmpeg-kit-ios-full-gpl (= 5.1)
- Flutter
- Flutter (1.0.0)
- flutter_image_compress_common (1.0.0):
- Flutter
- Mantle
- SDWebImage
- SDWebImageWebPCoder
- FMDB (2.7.5):
- FMDB/standard (= 2.7.5)
- FMDB/standard (2.7.5)
- just_audio (0.0.1):
- Flutter
- libphonenumber_plugin (0.0.1):
- Flutter
- PhoneNumberKit
- libwebp (1.3.2):
- libwebp/demux (= 1.3.2)
- libwebp/mux (= 1.3.2)
- libwebp/sharpyuv (= 1.3.2)
- libwebp/webp (= 1.3.2)
- libwebp/demux (1.3.2):
- libwebp/webp
- libwebp/mux (1.3.2):
- libwebp/demux
- libwebp/sharpyuv (1.3.2)
- libwebp/webp (1.3.2):
- libwebp/sharpyuv
- Mantle (2.2.0):
- Mantle/extobjc (= 2.2.0)
- Mantle/extobjc (2.2.0)
- map_launcher (0.0.1):
- Flutter
- open_filex (0.0.2):
- Flutter
- package_info_plus (0.4.5):
- Flutter
- path_provider_foundation (0.0.1):
- Flutter
- FlutterMacOS
- PhoneNumberKit (3.3.4):
- PhoneNumberKit/PhoneNumberKitCore (= 3.3.4)
- PhoneNumberKit/UIKit (= 3.3.4)
- PhoneNumberKit/PhoneNumberKitCore (3.3.4)
- PhoneNumberKit/UIKit (3.3.4):
- PhoneNumberKit/PhoneNumberKitCore
- sqflite (0.0.2):
- SDWebImage (5.18.5):
- SDWebImage/Core (= 5.18.5)
- SDWebImage/Core (5.18.5)
- SDWebImageWebPCoder (0.14.2):
- libwebp (~> 1.0)
- SDWebImage/Core (~> 5.17)
- sqflite (0.0.3):
- Flutter
- FMDB (>= 2.7.5)
- url_launcher_ios (0.0.1):
- Flutter
- video_compress (0.3.0):
- Flutter
- video_player_avfoundation (0.0.1):
- Flutter
- wakelock (0.0.1):
- FlutterMacOS
- wakelock_plus (0.0.1):
- Flutter

DEPENDENCIES:
- audio_session (from `.symlinks/plugins/audio_session/ios`)
- ffmpeg_kit_flutter_full_gpl (from `.symlinks/plugins/ffmpeg_kit_flutter_full_gpl/ios`)
- Flutter (from `Flutter`)
- flutter_image_compress_common (from `.symlinks/plugins/flutter_image_compress_common/ios`)
- just_audio (from `.symlinks/plugins/just_audio/ios`)
- libphonenumber_plugin (from `.symlinks/plugins/libphonenumber_plugin/ios`)
- map_launcher (from `.symlinks/plugins/map_launcher/ios`)
- open_filex (from `.symlinks/plugins/open_filex/ios`)
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- sqflite (from `.symlinks/plugins/sqflite/ios`)
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
- video_player_avfoundation (from `.symlinks/plugins/video_player_avfoundation/ios`)
- wakelock (from `.symlinks/plugins/wakelock/ios`)
- video_compress (from `.symlinks/plugins/video_compress/ios`)
- video_player_avfoundation (from `.symlinks/plugins/video_player_avfoundation/darwin`)
- wakelock_plus (from `.symlinks/plugins/wakelock_plus/ios`)

SPEC REPOS:
trunk:
- ffmpeg-kit-ios-full-gpl
- FMDB
- PhoneNumberKit
- libwebp
- Mantle
- SDWebImage
- SDWebImageWebPCoder

EXTERNAL SOURCES:
audio_session:
Expand All @@ -67,42 +94,51 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/ffmpeg_kit_flutter_full_gpl/ios"
Flutter:
:path: Flutter
flutter_image_compress_common:
:path: ".symlinks/plugins/flutter_image_compress_common/ios"
just_audio:
:path: ".symlinks/plugins/just_audio/ios"
libphonenumber_plugin:
:path: ".symlinks/plugins/libphonenumber_plugin/ios"
map_launcher:
:path: ".symlinks/plugins/map_launcher/ios"
open_filex:
:path: ".symlinks/plugins/open_filex/ios"
package_info_plus:
:path: ".symlinks/plugins/package_info_plus/ios"
path_provider_foundation:
:path: ".symlinks/plugins/path_provider_foundation/darwin"
sqflite:
:path: ".symlinks/plugins/sqflite/ios"
url_launcher_ios:
:path: ".symlinks/plugins/url_launcher_ios/ios"
video_compress:
:path: ".symlinks/plugins/video_compress/ios"
video_player_avfoundation:
:path: ".symlinks/plugins/video_player_avfoundation/ios"
wakelock:
:path: ".symlinks/plugins/wakelock/ios"
:path: ".symlinks/plugins/video_player_avfoundation/darwin"
wakelock_plus:
:path: ".symlinks/plugins/wakelock_plus/ios"

SPEC CHECKSUMS:
audio_session: 4f3e461722055d21515cf3261b64c973c062f345
ffmpeg-kit-ios-full-gpl: 2682965e5b3e7f13a05836d46d302eafe6c5039e
ffmpeg_kit_flutter_full_gpl: 7dcfcdc419f4667252cde1871859976bca328169
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
flutter_image_compress_common: ec1d45c362c9d30a3f6a0426c297f47c52007e3e
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
just_audio: baa7252489dbcf47a4c7cc9ca663e9661c99aafa
libphonenumber_plugin: e8a7d64a6624a7c25f2c4ab0b7ead2a8e341e35e
libwebp: 1786c9f4ff8a279e4dac1e8f385004d5fc253009
Mantle: c5aa8794a29a022dfbbfc9799af95f477a69b62d
map_launcher: e325db1261d029ff33e08e03baccffe09593ffea
open_filex: 6e26e659846ec990262224a12ef1c528bb4edbe4
path_provider_foundation: 37748e03f12783f9de2cb2c4eadfaa25fe6d4852
PhoneNumberKit: 441e8b26ec88d598e3591de9061eff18f5dd12e8
sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904
url_launcher_ios: ae1517e5e344f5544fb090b079e11f399dfbe4d2
video_player_avfoundation: e489aac24ef5cf7af82702979ed16f2a5ef84cff
wakelock: d0fc7c864128eac40eba1617cb5264d9c940b46f
package_info_plus: 115f4ad11e0698c8c1c5d8a689390df880f47e85
path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943
SDWebImage: 7ac2b7ddc5e8484c79aa90fc4e30b149d6a2c88f
SDWebImageWebPCoder: 633b813fca24f1de5e076bcd7f720c038b23892b
sqflite: 31f7eba61e3074736dff8807a9b41581e4f7f15a
url_launcher_ios: bf5ce03e0e2088bad9cc378ea97fa0ed5b49673b
video_compress: fce97e4fb1dfd88175aa07d2ffc8a2f297f87fbe
video_player_avfoundation: e9e6f9cae7d7a6d9b43519b0aab382bca60fcfd1
wakelock_plus: 8b09852c8876491e4b6d179e17dfe2a0b5f60d47

PODFILE CHECKSUM: da491a8b7d2d8eef05b8be02236cf916620dd0f4

COCOAPODS: 1.12.1
COCOAPODS: 1.14.3
18 changes: 15 additions & 3 deletions sample/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = CZXK68F2MF;
DEVELOPMENT_TEAM = 2U6X6P3626;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
Expand All @@ -368,8 +368,12 @@
);
PRODUCT_BUNDLE_IDENTIFIER = com.example.sample;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
};
name = Profile;
Expand Down Expand Up @@ -488,7 +492,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = CZXK68F2MF;
DEVELOPMENT_TEAM = 2U6X6P3626;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
Expand All @@ -498,9 +502,13 @@
);
PRODUCT_BUNDLE_IDENTIFIER = com.example.sample;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
};
name = Debug;
Expand All @@ -512,7 +520,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = CZXK68F2MF;
DEVELOPMENT_TEAM = 2U6X6P3626;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
Expand All @@ -522,8 +530,12 @@
);
PRODUCT_BUNDLE_IDENTIFIER = com.example.sample;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
};
name = Release;
Expand Down
2 changes: 2 additions & 0 deletions sample/macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import Foundation

import audio_session
import ffmpeg_kit_flutter_full_gpl
import flutter_image_compress_macos
import just_audio
import package_info_plus
import path_provider_foundation
Expand All @@ -19,6 +20,7 @@ import wakelock_plus
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
AudioSessionPlugin.register(with: registry.registrar(forPlugin: "AudioSessionPlugin"))
FFmpegKitFlutterPlugin.register(with: registry.registrar(forPlugin: "FFmpegKitFlutterPlugin"))
FlutterImageCompressMacosPlugin.register(with: registry.registrar(forPlugin: "FlutterImageCompressMacosPlugin"))
JustAudioPlugin.register(with: registry.registrar(forPlugin: "JustAudioPlugin"))
FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
Expand Down
50 changes: 49 additions & 1 deletion sample/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ packages:
path: ".."
relative: true
source: path
version: "0.0.88"
version: "0.0.95"
boolean_selector:
dependency: transitive
description:
Expand Down Expand Up @@ -104,6 +104,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.17.2"
cross_file:
dependency: transitive
description:
name: cross_file
sha256: "2f9d2cbccb76127ba28528cb3ae2c2326a122446a83de5a056aaa3880d3882c5"
url: "https://pub.dev"
source: hosted
version: "0.3.3+7"
crypto:
dependency: transitive
description:
Expand Down Expand Up @@ -221,6 +229,46 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.3.1"
flutter_image_compress:
dependency: transitive
description:
name: flutter_image_compress
sha256: f159d2e8c4ed04b8e36994124fd4a5017a0f01e831ae3358c74095c340e9ae5e
url: "https://pub.dev"
source: hosted
version: "2.1.0"
flutter_image_compress_common:
dependency: transitive
description:
name: flutter_image_compress_common
sha256: "7cad12802628706655920089cfe9ee1d1098300e7f39a079eb160458bbc47652"
url: "https://pub.dev"
source: hosted
version: "1.0.3"
flutter_image_compress_macos:
dependency: transitive
description:
name: flutter_image_compress_macos
sha256: fea1e3d71150d03373916b832c49b5c2f56c3e7e13da82a929274a2c6f88251e
url: "https://pub.dev"
source: hosted
version: "1.0.1"
flutter_image_compress_platform_interface:
dependency: transitive
description:
name: flutter_image_compress_platform_interface
sha256: eb4f055138b29b04498ebcb6d569aaaee34b64d75fb74ea0d40f9790bf47ee9d
url: "https://pub.dev"
source: hosted
version: "1.0.3"
flutter_image_compress_web:
dependency: transitive
description:
name: flutter_image_compress_web
sha256: da41cc3859f19d11c7d10be615f6a9dcf0907e7daffde7442bf4cc2486663660
url: "https://pub.dev"
source: hosted
version: "0.1.3+2"
flutter_lints:
dependency: "direct dev"
description:
Expand Down

0 comments on commit 381796a

Please sign in to comment.