Skip to content

Commit

Permalink
🔀 sync with changes
Browse files Browse the repository at this point in the history
  • Loading branch information
sarbagyastha committed Feb 21, 2024
1 parent 56bef14 commit b72befd
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 78 deletions.
65 changes: 1 addition & 64 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,64 +1 @@
analyzer:
exclude:
- 'example/**'

linter:
rules:
# STYLE
- camel_case_types
- library_names
- file_names
- library_prefixes
- non_constant_identifier_names
- constant_identifier_names # prefer
- directives_ordering
#- lines_longer_than_80_chars # avoid
- curly_braces_in_flow_control_structures

# DOCUMENTATION
- slash_for_doc_comments
- package_api_docs # prefer # ?
- public_member_api_docs # prefer # ?
#- comment_references # Unused because https://github.com/dart-lang/sdk/issues/36974

# USAGE
- avoid_relative_lib_imports # prefer
- prefer_adjacent_string_concatenation
- prefer_interpolation_to_compose_strings # prefer
- unnecessary_brace_in_string_interps # avoid
- prefer_collection_literals
- avoid_function_literals_in_foreach_calls # avoid
- prefer_iterable_whereType
- prefer_function_declarations_over_variables
- unnecessary_lambdas
- avoid_init_to_null
- unnecessary_getters_setters
#- unnecessary_getters # prefer # Disabled pending fix: https://github.com/dart-lang/linter/issues/23
#- prefer_expression_function_bodies # consider
- unnecessary_this
- prefer_initializing_formals
- type_init_formals
- empty_constructor_bodies
- unnecessary_new
- prefer_const_constructors
- avoid_catches_without_on_clauses # avoid
- use_rethrow_when_possible

# DESIGN
- use_to_and_as_if_applicable # prefer
- one_member_abstracts # avoid
- avoid_classes_with_only_static_members # avoid
- prefer_final_fields # prefer
- use_setters_to_change_properties
- avoid_setters_without_getters
- avoid_returning_this # avoid
- type_annotate_public_apis # prefer
#- prefer_typing_uninitialized_variables # consider
- omit_local_variable_types # avoid
- avoid_return_types_on_setters
- prefer_generic_function_type_aliases
- avoid_private_typedef_functions # prefer
#- use_function_type_syntax_for_parameters # consider
- avoid_positional_boolean_parameters # avoid
- hash_and_equals
- avoid_null_checks_in_equality_operators
include: package:flutter_lints/flutter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import FlutterMacOS
import Foundation

import flutter_inappwebview
import flutter_inappwebview_macos

func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
InAppWebViewFlutterPlugin.register(with: registry.registrar(forPlugin: "InAppWebViewFlutterPlugin"))
Expand Down
4 changes: 4 additions & 0 deletions packages/youtube_player_iframe/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Changelog
## 5.1.1
**Feb 21, 2024**
- Improves pub score.

## 5.1.0
**Feb 21, 2024**
- Bumps dependency to latest version.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class YoutubePlayerController implements YoutubePlayerIFrameAPI {
..setUserAgent(params.userAgent)
..addJavaScriptChannel(
_youtubeJSChannelName,
onMessageReceived: _eventHandler,
onMessageReceived: _eventHandler.call,
)
..enableZoom(false);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ class YoutubeValueBuilder extends StatefulWidget {
///
/// The [builder] must not be null.
const YoutubeValueBuilder({
Key? key,
super.key,
required this.builder,
this.buildWhen,
this.controller,
}) : super(key: key);
});

@override
_YoutubeValueBuilderState createState() => _YoutubeValueBuilderState();
State<YoutubeValueBuilder> createState() => _YoutubeValueBuilderState();
}

class _YoutubeValueBuilderState extends State<YoutubeValueBuilder> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ class YoutubePlayerControllerProvider extends InheritedWidget {
}

@override
bool updateShouldNotify(YoutubePlayerControllerProvider old) {
return old.controller.hashCode != controller.hashCode;
bool updateShouldNotify(YoutubePlayerControllerProvider oldWidget) {
return oldWidget.controller.hashCode != controller.hashCode;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ class _FullscreenYoutubePlayerState extends State<FullscreenYoutubePlayer> {
autoPlay: true,
params: const YoutubePlayerParams(showFullscreenButton: true),
)..setFullScreenListener((_) async {
Navigator.pop(context, await _controller.currentTime);
final currentTime = await _controller.currentTime;
if (!mounted) return;

Navigator.pop(context, currentTime);
});

SystemChrome.setPreferredOrientations(
Expand Down
5 changes: 4 additions & 1 deletion packages/youtube_player_iframe/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: youtube_player_iframe
description: Flutter port of the official YouTube iFrame player API. Supports web & mobile platforms.
version: 5.1.0
version: 5.1.1
repository: https://github.com/sarbagyastha/youtube_player_flutter
homepage: https://github.com/sarbagyastha/youtube_player_flutter/tree/master/packages/youtube_player_iframe

Expand All @@ -18,6 +18,9 @@ dependencies:
url_launcher: ^6.2.4
youtube_player_iframe_web: ^3.0.1

dev_dependencies:
flutter_lints: ^3.0.1

flutter:
assets:
- assets/player.html
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,9 @@ class WebYoutubePlayerIframeController extends PlatformWebViewController {
/// An implementation of [PlatformWebViewWidget] using Flutter the for Web API.
class YoutubePlayerIframeWeb extends PlatformWebViewWidget {
/// Constructs a [YoutubePlayerIframeWeb].
YoutubePlayerIframeWeb(PlatformWebViewWidgetCreationParams params)
YoutubePlayerIframeWeb(super.params)
: _controller = params.controller as WebYoutubePlayerIframeController,
super.implementation(params) {
super.implementation() {
platformViewRegistry.registerViewFactory(
_controller._params.ytiFrame.id,
(int viewId) => _controller._params.ytiFrame,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ class WebYoutubePlayerIframePlatform extends WebViewPlatform {
/// An implementation of [PlatformNavigationDelegate] using Flutter for Web API.
class WebNavigationDelegate extends PlatformNavigationDelegate {
/// Creates a new [WebNavigationDelegate] instance.
WebNavigationDelegate(PlatformNavigationDelegateCreationParams params)
: super.implementation(params);
WebNavigationDelegate(super.params) : super.implementation();

@override
Future<void> setOnNavigationRequest(
Expand Down
3 changes: 2 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ environment:
sdk: '>=3.0.0 <4.0.0'

dev_dependencies:
melos: ^3.4.0
melos: ^3.4.0
flutter_lints: ^3.0.1

0 comments on commit b72befd

Please sign in to comment.