From 19369cd74c3b430be76a8ec4543b27f6d57580e2 Mon Sep 17 00:00:00 2001 From: Chojecki Date: Tue, 31 Oct 2023 11:02:58 +0100 Subject: [PATCH 1/3] init --- example/.flutter-plugins-dependencies | 2 +- example/pubspec.lock | 2 +- lib/subtitle_text_view.dart | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/example/.flutter-plugins-dependencies b/example/.flutter-plugins-dependencies index 486dd58..4dc3ce0 100644 --- a/example/.flutter-plugins-dependencies +++ b/example/.flutter-plugins-dependencies @@ -1 +1 @@ -{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"video_player_avfoundation","path":"/Users/jorandob/.pub-cache/hosted/pub.dev/video_player_avfoundation-2.3.4/","native_build":true,"dependencies":[]},{"name":"wakelock","path":"/Users/jorandob/.pub-cache/hosted/pub.dev/wakelock-0.6.1+2/","native_build":true,"dependencies":[]}],"android":[{"name":"video_player_android","path":"/Users/jorandob/.pub-cache/hosted/pub.dev/video_player_android-2.3.4/","native_build":true,"dependencies":[]},{"name":"wakelock","path":"/Users/jorandob/.pub-cache/hosted/pub.dev/wakelock-0.6.1+2/","native_build":true,"dependencies":[]}],"macos":[{"name":"wakelock_macos","path":"/Users/jorandob/.pub-cache/hosted/pub.dev/wakelock_macos-0.4.0/","native_build":true,"dependencies":[]}],"linux":[],"windows":[],"web":[{"name":"video_player_web","path":"/Users/jorandob/.pub-cache/hosted/pub.dev/video_player_web-2.0.10/","dependencies":[]},{"name":"wakelock_web","path":"/Users/jorandob/.pub-cache/hosted/pub.dev/wakelock_web-0.4.0/","dependencies":[]}]},"dependencyGraph":[{"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":"wakelock","dependencies":["wakelock_macos","wakelock_web"]},{"name":"wakelock_macos","dependencies":[]},{"name":"wakelock_web","dependencies":[]}],"date_created":"2023-09-30 16:01:29.270889","version":"3.13.0"} \ No newline at end of file +{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"video_player_avfoundation","path":"/Users/marekchojecki/.pub-cache/hosted/pub.dev/video_player_avfoundation-2.3.4/","native_build":true,"dependencies":[]},{"name":"wakelock","path":"/Users/marekchojecki/.pub-cache/hosted/pub.dev/wakelock-0.6.1+2/","native_build":true,"dependencies":[]}],"android":[{"name":"video_player_android","path":"/Users/marekchojecki/.pub-cache/hosted/pub.dev/video_player_android-2.3.4/","native_build":true,"dependencies":[]},{"name":"wakelock","path":"/Users/marekchojecki/.pub-cache/hosted/pub.dev/wakelock-0.6.1+2/","native_build":true,"dependencies":[]}],"macos":[{"name":"wakelock_macos","path":"/Users/marekchojecki/.pub-cache/hosted/pub.dev/wakelock_macos-0.4.0/","native_build":true,"dependencies":[]}],"linux":[],"windows":[],"web":[{"name":"video_player_web","path":"/Users/marekchojecki/.pub-cache/hosted/pub.dev/video_player_web-2.0.10/","dependencies":[]},{"name":"wakelock_web","path":"/Users/marekchojecki/.pub-cache/hosted/pub.dev/wakelock_web-0.4.0/","dependencies":[]}]},"dependencyGraph":[{"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":"wakelock","dependencies":["wakelock_macos","wakelock_web"]},{"name":"wakelock_macos","dependencies":[]},{"name":"wakelock_web","dependencies":[]}],"date_created":"2023-10-31 11:01:33.658902","version":"3.13.7"} \ No newline at end of file diff --git a/example/pubspec.lock b/example/pubspec.lock index 103eda5..72ae104 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -251,7 +251,7 @@ packages: path: ".." relative: true source: path - version: "2.1.1" + version: "2.2.0" term_glyph: dependency: transitive description: diff --git a/lib/subtitle_text_view.dart b/lib/subtitle_text_view.dart index 7c5c794..33e6826 100644 --- a/lib/subtitle_text_view.dart +++ b/lib/subtitle_text_view.dart @@ -47,6 +47,8 @@ class SubtitleTextView extends StatelessWidget { children: [ Center( child: Container( + padding: const EdgeInsets.all(8.0), + width: double.infinity, color: backgroundColor, child: _TextContent( text: state.subtitle!.text, From 8746a79820ec3bd6459bf96e36ea56db6088ba19 Mon Sep 17 00:00:00 2001 From: Chojecki Date: Tue, 31 Oct 2023 11:13:49 +0100 Subject: [PATCH 2/3] padding config --- lib/subtitle_text_view.dart | 10 ++++++++-- lib/subtitle_wrapper.dart | 6 ++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/lib/subtitle_text_view.dart b/lib/subtitle_text_view.dart index 33e6826..3b67191 100644 --- a/lib/subtitle_text_view.dart +++ b/lib/subtitle_text_view.dart @@ -9,9 +9,13 @@ class SubtitleTextView extends StatelessWidget { required this.subtitleStyle, super.key, this.backgroundColor, + this.fullWidth = false, + this.padding, }); final SubtitleStyle subtitleStyle; final Color? backgroundColor; + final bool fullWidth; + final double? padding; TextStyle get _textStyle { return subtitleStyle.hasBorder @@ -47,8 +51,10 @@ class SubtitleTextView extends StatelessWidget { children: [ Center( child: Container( - padding: const EdgeInsets.all(8.0), - width: double.infinity, + padding: padding != null + ? EdgeInsets.all(padding!) + : EdgeInsets.zero, + width: fullWidth ? double.infinity : null, color: backgroundColor, child: _TextContent( text: state.subtitle!.text, diff --git a/lib/subtitle_wrapper.dart b/lib/subtitle_wrapper.dart index ea88742..6b45885 100644 --- a/lib/subtitle_wrapper.dart +++ b/lib/subtitle_wrapper.dart @@ -12,12 +12,16 @@ class SubtitleWrapper extends StatelessWidget { super.key, this.subtitleStyle = const SubtitleStyle(), this.backgroundColor, + this.fullWidth = false, + this.padding, }); final Widget videoChild; final SubtitleController subtitleController; final VideoPlayerController videoPlayerController; final SubtitleStyle subtitleStyle; final Color? backgroundColor; + final bool fullWidth; + final double? padding; @override Widget build(BuildContext context) { @@ -45,6 +49,8 @@ class SubtitleWrapper extends StatelessWidget { child: SubtitleTextView( subtitleStyle: subtitleStyle, backgroundColor: backgroundColor, + fullWidth: fullWidth, + padding: padding, ), ), ) From 539a7750cb4a6ce9212895094fc0ac0354659c2e Mon Sep 17 00:00:00 2001 From: Chojecki Date: Tue, 31 Oct 2023 11:15:25 +0100 Subject: [PATCH 3/3] version --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index c71c610..fd078d3 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: subtitle_wrapper_package description: A Subtitle Wrapper package, this subtitle wrapper package displays subtitles for a video player. -version: 2.2.0 +version: 2.2.1 homepage: https://github.com/Joran-Dob/flutter_subtitle_wrapper environment: