Skip to content

Commit

Permalink
Merge pull request #29 from Giphy/v1.0.1
Browse files Browse the repository at this point in the history
- Release 1.0.1
  • Loading branch information
ALexanderLonsky authored Oct 18, 2024
2 parents a637dff + d8e90f0 commit 37a4af7
Show file tree
Hide file tree
Showing 30 changed files with 71 additions and 58 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
## 1.0.1

### Native SDKs

- Giphy Android SDK [v2.3.15](https://github.com/Giphy/giphy-android-sdk/releases/tag/v2.3.15)
- Giphy iOS SDK [v2.2.13](https://github.com/Giphy/giphy-ios-sdk/releases/tag/v2.2.13)

### Static Analysis
- Address Static Analysis issues

### Bug Fixes
- Add support for Xcode 16

## 1.0.0

### Native SDKs
Expand Down
2 changes: 1 addition & 1 deletion example/ios/Runner/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import UIKit
import Flutter

@UIApplicationMain
@main
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
Expand Down
2 changes: 1 addition & 1 deletion example/lib/settings_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class _SettingsScreenState extends State<SettingsScreen> {
Widget build(BuildContext context) {
return PopScope(
canPop: false,
onPopInvoked: (didPop) {
onPopInvokedWithResult: (didPop, result) {
if (didPop) return;
Navigator.of(context).pop(_temporarySettings);
},
Expand Down
2 changes: 1 addition & 1 deletion ios/giphy_flutter_sdk.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ Pod::Spec.new do |s|
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' }
s.swift_version = '5.0'

s.dependency "Giphy", "2.2.10"
s.dependency "Giphy", "2.2.13"
end
20 changes: 13 additions & 7 deletions lib/dto/giphy_content_request.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@ class GiphyContentRequest {

/// Creates a [GiphyContentRequest] for searching content.
factory GiphyContentRequest.search(
{required GiphyMediaType mediaType, GiphyRating rating = GiphyRating
.pg13, required String searchQuery}) {
return GiphyContentRequest(requestType: GiphyContentRequestType.search,
{required GiphyMediaType mediaType,
GiphyRating rating = GiphyRating.pg13,
required String searchQuery}) {
return GiphyContentRequest(
requestType: GiphyContentRequestType.search,
mediaType: mediaType,
rating: rating,
searchQuery: searchQuery);
Expand All @@ -46,7 +48,8 @@ class GiphyContentRequest {
factory GiphyContentRequest.trending(
{required GiphyMediaType mediaType,
GiphyRating rating = GiphyRating.pg13}) {
return GiphyContentRequest(requestType: GiphyContentRequestType.trending,
return GiphyContentRequest(
requestType: GiphyContentRequestType.trending,
mediaType: mediaType,
rating: rating);
}
Expand Down Expand Up @@ -97,10 +100,13 @@ class GiphyContentRequest {
/// Creates a [GiphyContentRequest] instance from a JSON object.
factory GiphyContentRequest.fromJson(Map<Object?, Object?> json) {
return GiphyContentRequest(
mediaType: GiphyMediaTypeExtension.fromStringValue(json['mediaType'] as String),
rating: json['rating'] != null ? GiphyRatingExtension.fromStringValue(json['rating'] as String) : null,
mediaType:
GiphyMediaTypeExtension.fromStringValue(json['mediaType'] as String),
rating: json['rating'] != null
? GiphyRatingExtension.fromStringValue(json['rating'] as String)
: null,
requestType: GiphyContentRequestType.values.firstWhere(
(e) => e.toString().split('.').last == json['requestType'] as String?,
(e) => e.toString().split('.').last == json['requestType'] as String?,
orElse: () => GiphyContentRequestType.trending,
),
searchQuery: json['searchQuery'] as String? ?? '',
Expand Down
1 change: 0 additions & 1 deletion lib/dto/giphy_content_type.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ enum GiphyContentType {

/// Extension methods for [GiphyContentType] to convert from and to string values.
extension GiphyContentTypeExtension on GiphyContentType {

/// Converts a string value to a corresponding [GiphyContentType] enum value.
///
/// Throws an [ArgumentError] if the given string does not match any [GiphyContentType] values.
Expand Down
1 change: 0 additions & 1 deletion lib/dto/giphy_file_format.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ enum GiphyFileFormat {

/// Extension methods for [GiphyFileFormat] to convert from and to string values.
extension GiphyFileFormatExtension on GiphyFileFormat {

/// Converts a string value to a corresponding [GiphyFileFormat] enum value.
///
/// Throws an [ArgumentError] if the given string does not match any [GiphyFileFormat] values.
Expand Down
5 changes: 4 additions & 1 deletion lib/dto/giphy_image.dart
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ class GiphyImage {
webPUrl: json['webPUrl'] as String?,
webPSize: json['webPSize'] as int? ?? 0,
mediaId: json['mediaId'] as String?,
renditionType: json['renditionType'] != null ? GiphyRenditionUtil.fromStringValue(json['renditionType'] as String) as GiphyRendition? : null,
renditionType: json['renditionType'] != null
? GiphyRenditionUtil.fromStringValue(json['renditionType'] as String)
as GiphyRendition?
: null,
);
}

Expand Down
3 changes: 1 addition & 2 deletions lib/dto/giphy_media_type.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ enum GiphyMediaType {

/// Extension methods for [GiphyMediaType] to convert from and to string values.
extension GiphyMediaTypeExtension on GiphyMediaType {

/// Converts a string value to a corresponding [GiphyMediaType].
///
///
/// Throws an [ArgumentError] if the given string does not match any of the [GiphyMediaType] values.
///
/// [value] The string representation of the Giphy media type.
Expand Down
1 change: 0 additions & 1 deletion lib/dto/giphy_rating.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ enum GiphyRating {

/// Extension methods for [GiphyRating] to convert from and to string values.
extension GiphyRatingExtension on GiphyRating {

/// Converts a string value to a corresponding [GiphyRating] enum value.
///
/// Throws an [ArgumentError] if the given string does not match any [GiphyRating] values.
Expand Down
2 changes: 0 additions & 2 deletions lib/dto/giphy_rendition.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/// An enumeration representing a Giphy Rendition Type (e.g., original/preview/...)
enum GiphyRendition {

/// Original file size and file dimensions. Good for desktop use.
original,

Expand Down Expand Up @@ -63,7 +62,6 @@ enum GiphyRendition {
/// Certain renditions (cases of the GiphyRendition enum) are not available for Clips.
/// To account for this limitation, we created this property specifically to work with Clips.
enum GiphyClipsRendition {

/// Original file size and file dimensions. Good for desktop use.
original,

Expand Down
14 changes: 6 additions & 8 deletions lib/dto/giphy_settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import 'giphy_theme.dart';

/// A configuration class for Giphy settings.
class GiphySettings {

/// The theme to use for the Giphy UI.
final GiphyTheme theme;

Expand Down Expand Up @@ -142,23 +141,22 @@ class GiphySettings {
theme: theme ?? this.theme,
mediaTypeConfig: mediaTypeConfig ?? this.mediaTypeConfig,
showConfirmationScreen:
showConfirmationScreen ?? this.showConfirmationScreen,
showConfirmationScreen ?? this.showConfirmationScreen,
rating: rating ?? this.rating,
renditionType: renditionType ?? this.renditionType,
clipsPreviewRenditionType:
clipsPreviewRenditionType ?? this.clipsPreviewRenditionType,
clipsPreviewRenditionType ?? this.clipsPreviewRenditionType,
confirmationRenditionType:
confirmationRenditionType ?? this.confirmationRenditionType,
confirmationRenditionType ?? this.confirmationRenditionType,
showCheckeredBackground:
showCheckeredBackground ?? this.showCheckeredBackground,
showCheckeredBackground ?? this.showCheckeredBackground,
stickerColumnCount: stickerColumnCount ?? this.stickerColumnCount,
selectedContentType:
selectedContentType ?? this.selectedContentType,
selectedContentType: selectedContentType ?? this.selectedContentType,
showSuggestionsBar: showSuggestionsBar ?? this.showSuggestionsBar,
enableDynamicText: enableDynamicText ?? this.enableDynamicText,
fileFormat: fileFormat ?? this.fileFormat,
disableEmojiVariations:
disableEmojiVariations ?? this.disableEmojiVariations,
disableEmojiVariations ?? this.disableEmojiVariations,
);
}
}
3 changes: 2 additions & 1 deletion lib/dto/giphy_theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ class GiphyTheme {
final Color? retryButtonTextColor;

/// Predefined automatic Giphy theme.
static const GiphyTheme automaticTheme = GiphyTheme._private(preset: GiphyThemePreset.automatic);
static const GiphyTheme automaticTheme =
GiphyTheme._private(preset: GiphyThemePreset.automatic);

// Private constructor with optional parameters.
const GiphyTheme._private({
Expand Down
19 changes: 14 additions & 5 deletions lib/dto/giphy_video.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import 'giphy_video_previews.dart';

/// A class representing a Giphy video
class GiphyVideo {

/// The URL for the HLS manifest.
final String? hlsManifestURL;

Expand Down Expand Up @@ -43,10 +42,20 @@ class GiphyVideo {
return GiphyVideo(
hlsManifestURL: json['hlsManifestURL'] as String?,
dashManifestURL: json['dashManifestURL'] as String?,
assets: json['assets'] != null ? GiphyAssets.fromJson(json['assets'] as Map<Object?, Object?>) : null,
previews: json['previews'] != null ? GiphyVideoPreviews.fromJson(json['previews'] as Map<Object?, Object?>) : null,
captions: json['captions'] != null ? GiphyVideoCaptions.fromJson(json['captions'] as Map<Object?, Object?>) : null,
duration: json['duration'] != null ? (json['duration'] as num).toDouble() : null,
assets: json['assets'] != null
? GiphyAssets.fromJson(json['assets'] as Map<Object?, Object?>)
: null,
previews: json['previews'] != null
? GiphyVideoPreviews.fromJson(
json['previews'] as Map<Object?, Object?>)
: null,
captions: json['captions'] != null
? GiphyVideoCaptions.fromJson(
json['captions'] as Map<Object?, Object?>)
: null,
duration: json['duration'] != null
? (json['duration'] as num).toDouble()
: null,
);
}

Expand Down
2 changes: 1 addition & 1 deletion lib/dto/giphy_video_captions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ class GiphyVideoCaptions {
'en': videoCaption?.toJson(),
};
}
}
}
1 change: 0 additions & 1 deletion lib/dto/giphy_video_preview_asset.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,3 @@ class GiphyVideoPreviewAsset {
};
}
}

6 changes: 4 additions & 2 deletions lib/dto/giphy_video_previews.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ class GiphyVideoPreviews {
/// the preview asset as a nested JSON object.
factory GiphyVideoPreviews.fromJson(Map<Object?, Object?> json) {
return GiphyVideoPreviews(
fixedWidth: GiphyVideoPreviewAsset.fromJson(json['fixedWidth'] as Map<Object?, Object?>),
fixedHeight: GiphyVideoPreviewAsset.fromJson(json['fixedHeight'] as Map<Object?, Object?>),
fixedWidth: GiphyVideoPreviewAsset.fromJson(
json['fixedWidth'] as Map<Object?, Object?>),
fixedHeight: GiphyVideoPreviewAsset.fromJson(
json['fixedHeight'] as Map<Object?, Object?>),
);
}

Expand Down
1 change: 0 additions & 1 deletion lib/giphy_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,3 @@ class GiphyDialog {
}
}
}

1 change: 0 additions & 1 deletion lib/giphy_flutter_sdk.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,3 @@ class GiphyFlutterSDK {
.configure(apiKey, verificationMode, videoCacheMaxBytes);
}
}

1 change: 0 additions & 1 deletion lib/giphy_grid_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -185,4 +185,3 @@ class _GiphyGridViewState extends State<GiphyGridView> {
await _channel.invokeMethod('setTheme', {'theme': widget.theme.toJson()});
}
}

1 change: 0 additions & 1 deletion lib/giphy_media_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -189,4 +189,3 @@ class GiphyMediaViewController {
/// Resumes the paused animation in the associated [GiphyMediaView].
Future<void> resume() async => _state?.resume();
}

3 changes: 1 addition & 2 deletions lib/giphy_video_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import 'package:giphy_flutter_sdk/specs/giphy_video_manager_platform_interface.d
class GiphyVideoManager {
/// The singleton instance of [GiphyVideoManager].
static final GiphyVideoManager _instance =
GiphyVideoManager._privateConstructor();
GiphyVideoManager._privateConstructor();

/// Private constructor for the singleton instance.
GiphyVideoManager._privateConstructor();
Expand Down Expand Up @@ -37,4 +37,3 @@ class GiphyVideoManager {
GiphyVideoManagerPlatform.instance.resume();
}
}

17 changes: 8 additions & 9 deletions lib/giphy_video_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ class GiphyVideoView extends StatefulWidget {
/// Constructs a GiphyVideoView.
const GiphyVideoView(
{super.key,
this.mediaId,
this.media,
this.autoPlay = true,
this.muted = false,
this.onMute,
this.onUnmute,
this.onPlaybackStateChanged,
this.onError});
this.mediaId,
this.media,
this.autoPlay = true,
this.muted = false,
this.onMute,
this.onUnmute,
this.onPlaybackStateChanged,
this.onError});

@override
State<GiphyVideoView> createState() => _GiphyVideoViewState();
Expand Down Expand Up @@ -195,4 +195,3 @@ class _GiphyVideoViewState extends State<GiphyVideoView>
await _channel.invokeMethod('setMuted', {'muted': widget.muted});
}
}

1 change: 0 additions & 1 deletion lib/specs/giphy_dialog_method_channel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,3 @@ class GiphyDialogMethodChannel extends GiphyDialogPlatform {
await _channel.invokeMethod('hide');
}
}

1 change: 0 additions & 1 deletion lib/specs/giphy_dialog_platform_interface.dart
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,3 @@ abstract class GiphyDialogPlatform extends PlatformInterface {
throw UnimplementedError('hide() has not been implemented.');
}
}

1 change: 0 additions & 1 deletion lib/specs/giphy_flutter_sdk_method_channel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,3 @@ class GiphyFlutterSdkPlatformChannel extends GiphyFlutterSdkPlatform {
});
}
}

1 change: 0 additions & 1 deletion lib/specs/giphy_flutter_sdk_platform_interface.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,3 @@ abstract class GiphyFlutterSdkPlatform extends PlatformInterface {
throw UnimplementedError('configure() has not been implemented.');
}
}

1 change: 0 additions & 1 deletion lib/specs/giphy_video_manager_method_channel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,3 @@ class GiphyVideoManagerMethodChannel extends GiphyVideoManagerPlatform {
await _channel.invokeMethod('resume');
}
}

1 change: 0 additions & 1 deletion lib/specs/giphy_video_manager_platform_interface.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,3 @@ abstract class GiphyVideoManagerPlatform extends PlatformInterface {
throw UnimplementedError('resume() has not been implemented.');
}
}

2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: giphy_flutter_sdk
description: "A Flutter plugin for integrating Giphy SDK in Android/iOS application."
version: 1.0.0
version: 1.0.1
homepage: https://github.com/Giphy/giphy-flutter-sdk

environment:
Expand Down

0 comments on commit 37a4af7

Please sign in to comment.