diff --git a/analysis_options.yaml b/analysis_options.yaml index 18aea978..3eeb57ec 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -1,10 +1,11 @@ include: package:very_good_analysis/analysis_options.yaml analyzer: + exclude: + - "**" errors: missing_required_param: error prefer_const_declarations: warning prefer_const_constructors: warning - import_of_legacy_library_into_null_safe: warning public_member_api_docs: ignore language: strict-casts: true diff --git a/example/lib/screens/cutom_video_controllers.dart b/example/lib/screens/cutom_video_controllers.dart index ce511edb..db1bc89a 100644 --- a/example/lib/screens/cutom_video_controllers.dart +++ b/example/lib/screens/cutom_video_controllers.dart @@ -15,8 +15,7 @@ class _CustomVideoControllsState extends State { late PodPlayerController controller; bool? isVideoPlaying; final videoTextFieldCtr = TextEditingController( - text: - 'https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerFun.mp4', + text: 'https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerFun.mp4', ); final vimeoTextFieldCtr = TextEditingController( text: '518228118', @@ -67,22 +66,18 @@ class _CustomVideoControllsState extends State { Widget build(BuildContext context) { /// const sizeH20 = SizedBox(height: 20); - final totalHour = controller.currentVideoPosition.inHours == 0 - ? '0' - : '${controller.currentVideoPosition.inHours}:'; - final totalMinute = - controller.currentVideoPosition.toString().split(':')[1]; - final totalSeconds = (controller.currentVideoPosition - - Duration(minutes: controller.currentVideoPosition.inMinutes)) - .inSeconds - .toString() - .padLeft(2, '0'); + final totalHour = + controller.currentVideoPosition.inHours == 0 ? '0' : '${controller.currentVideoPosition.inHours}:'; + final totalMinute = controller.currentVideoPosition.toString().split(':')[1]; + final totalSeconds = + (controller.currentVideoPosition - Duration(minutes: controller.currentVideoPosition.inMinutes)) + .inSeconds + .toString() + .padLeft(2, '0'); /// const videoTitle = Padding( - padding: kIsWeb - ? EdgeInsets.symmetric(vertical: 25, horizontal: 15) - : EdgeInsets.only(left: 15), + padding: kIsWeb ? EdgeInsets.symmetric(vertical: 25, horizontal: 15) : EdgeInsets.only(left: 15), child: Text( 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.', style: TextStyle( @@ -149,46 +144,37 @@ class _CustomVideoControllsState extends State { sizeH20, _loadVideoFromYoutube(), sizeH20, - _iconButton('Hide progress bar on overlay hidden', - Icons.hide_source, onPressed: () { + _iconButton('Hide progress bar on overlay hidden', Icons.hide_source, onPressed: () { setState(() { alwaysShowProgressBar = false; }); }), sizeH20, - _iconButton('Show Overlay', Icons.slideshow_outlined, - onPressed: () { + _iconButton('Show Overlay', Icons.slideshow_outlined, onPressed: () { controller.showOverlay(); }), sizeH20, - _iconButton('Hide Overlay', Icons.hide_image, - onPressed: () { + _iconButton('Hide Overlay', Icons.hide_image, onPressed: () { controller.hideOverlay(); }), - _iconButton('Backward video 5s', Icons.replay_5_rounded, - onPressed: () { + _iconButton('Backward video 5s', Icons.replay_5_rounded, onPressed: () { controller.doubleTapVideoBackward(5); }), sizeH20, - _iconButton('Forward video 5s', Icons.forward_5_rounded, - onPressed: () { + _iconButton('Forward video 5s', Icons.forward_5_rounded, onPressed: () { controller.doubleTapVideoForward(5); }), sizeH20, - _iconButton('Video Jump to 01:00 minute', - Icons.fast_forward_rounded, onPressed: () { + _iconButton('Video Jump to 01:00 minute', Icons.fast_forward_rounded, onPressed: () { controller.videoSeekTo(const Duration(minutes: 1)); }), sizeH20, - _iconButton('Enable full screen', Icons.fullscreen, - onPressed: () { + _iconButton('Enable full screen', Icons.fullscreen, onPressed: () { controller.enableFullScreen(); }), sizeH20, - _iconButton( - controller.isMute ? 'UnMute video' : 'mute video', - controller.isMute ? Icons.volume_up : Icons.volume_off, - onPressed: () { + _iconButton(controller.isMute ? 'UnMute video' : 'mute video', + controller.isMute ? Icons.volume_up : Icons.volume_off, onPressed: () { controller.toggleVolume(); }), sizeH20, @@ -217,16 +203,19 @@ class _CustomVideoControllsState extends State { backgroundColor: Colors.black, onPressed: () => controller.togglePlayPause(), child: isVideoPlaying == null - ? const SizedBox( + ? SizedBox( height: 20, width: 20, child: CircularProgressIndicator( backgroundColor: Colors.black, - color: Colors.white, + color: Theme.of(context).colorScheme.primary, strokeWidth: 1, ), ) - : Icon(!isVideoPlaying! ? Icons.play_arrow : Icons.pause), + : Icon( + !isVideoPlaying! ? Icons.play_arrow : Icons.pause, + color: Theme.of(context).colorScheme.primary, + ), ), ); } @@ -267,8 +256,7 @@ class _CustomVideoControllsState extends State { if (!mounted) return; ScaffoldMessenger.of(context).hideCurrentSnackBar(); } catch (e) { - snackBar( - "Unable to load,${kIsWeb ? 'Please enable CORS in web' : ''} \n$e"); + snackBar("Unable to load,${kIsWeb ? 'Please enable CORS in web' : ''} \n$e"); } }, child: const Text('Load Video'), @@ -313,8 +301,7 @@ class _CustomVideoControllsState extends State { if (!mounted) return; ScaffoldMessenger.of(context).hideCurrentSnackBar(); } catch (e) { - snackBar( - "Unable to load,${kIsWeb ? 'Please enable CORS in web' : ''} \n$e"); + snackBar("Unable to load,${kIsWeb ? 'Please enable CORS in web' : ''} \n$e"); } }, child: const Text('Load Video'), @@ -372,12 +359,10 @@ class _CustomVideoControllsState extends State { ); } - ElevatedButton _iconButton(String text, IconData icon, - {void Function()? onPressed}) { + ElevatedButton _iconButton(String text, IconData icon, {void Function()? onPressed}) { return ElevatedButton.icon( onPressed: onPressed ?? () {}, - style: ElevatedButton.styleFrom( - fixedSize: const Size.fromWidth(double.maxFinite)), + style: ElevatedButton.styleFrom(fixedSize: const Size.fromWidth(double.maxFinite)), icon: Icon(icon), label: Text(text)); } diff --git a/example/lib/screens/from_youtube.dart b/example/lib/screens/from_youtube.dart index 8c10ec69..98df9b66 100644 --- a/example/lib/screens/from_youtube.dart +++ b/example/lib/screens/from_youtube.dart @@ -39,6 +39,7 @@ class _PlayVideoFromVimeoIdState extends State { shrinkWrap: true, children: [ PodVideoPlayer( + podProgressBarConfig: const PodProgressBarConfig(), controller: controller, videoThumbnail: const DecorationImage( image: NetworkImage( diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 687fec49..261d1196 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -15,17 +15,18 @@ dependencies: pod_player: path: ../ - cupertino_icons: ^1.0.5 - visibility_detector: ^0.3.3 + cupertino_icons: + visibility_detector: dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^2.0.1 + flutter_lints: flutter: uses-material-design: true - + assets: - - assets/ \ No newline at end of file + - assets/ + diff --git a/lib/src/controllers/pod_base_controller.dart b/lib/src/controllers/pod_base_controller.dart index 4edc604c..28e17532 100644 --- a/lib/src/controllers/pod_base_controller.dart +++ b/lib/src/controllers/pod_base_controller.dart @@ -81,13 +81,15 @@ class _PodBaseController extends GetxController { ///updates state with id `_podVideoState` void podVideoStateChanger(PodVideoState? val, {bool updateUi = true}) { - if (_podVideoState != (val ?? _podVideoState)) { - _podVideoState = val ?? _podVideoState; - if (updateUi) { - update(['podVideoState']); - update(['update-all']); - } + // 判断前值, 会导致 player 隐藏后无法再控制播放和暂停 + // if (_podVideoState != (val ?? _podVideoState)) { + _podVideoState = val ?? _podVideoState; + if (updateUi) { + // print("podVideoStateChanger val=$val _podVideoState=$_podVideoState"); + update(['podVideoState']); + update(['update-all']); } + // } } void _listneToVideoPosition() { @@ -96,8 +98,7 @@ class _PodBaseController extends GetxController { update(['video-progress']); update(['update-all']); } else { - if (_videoPosition.inSeconds != - (_videoCtr?.value.position ?? Duration.zero).inSeconds) { + if (_videoPosition.inSeconds != (_videoCtr?.value.position ?? Duration.zero).inSeconds) { _videoPosition = _videoCtr?.value.position ?? Duration.zero; update(['video-progress']); update(['update-all']); diff --git a/lib/src/controllers/pod_getx_video_controller.dart b/lib/src/controllers/pod_getx_video_controller.dart index 7a46d30d..769e0deb 100644 --- a/lib/src/controllers/pod_getx_video_controller.dart +++ b/lib/src/controllers/pod_getx_video_controller.dart @@ -93,7 +93,6 @@ class PodGetXVideoController extends _PodGesturesController { httpHeaders: playVideoFrom.httpHeaders, ); playingVideoUrl = playVideoFrom.dataSource; - break; case PodVideoPlayerType.networkQualityUrls: final url = await getUrlFromVideoQualityUrls( qualityList: podPlayerConfig.videoQualityPriority, @@ -110,7 +109,6 @@ class PodGetXVideoController extends _PodGesturesController { ); playingVideoUrl = url; - break; case PodVideoPlayerType.youtube: final urls = await getVideoQualityUrlsFromYoutube( playVideoFrom.dataSource!, @@ -131,7 +129,6 @@ class PodGetXVideoController extends _PodGesturesController { ); playingVideoUrl = url; - break; case PodVideoPlayerType.vimeo: await getQualityUrlsFromVimeoId( playVideoFrom.dataSource!, @@ -151,7 +148,6 @@ class PodGetXVideoController extends _PodGesturesController { ); playingVideoUrl = url; - break; case PodVideoPlayerType.asset: /// @@ -163,7 +159,6 @@ class PodGetXVideoController extends _PodGesturesController { ); playingVideoUrl = playVideoFrom.dataSource; - break; case PodVideoPlayerType.file: if (kIsWeb) { throw Exception('file doesnt support web'); @@ -176,7 +171,6 @@ class PodGetXVideoController extends _PodGesturesController { videoPlayerOptions: playVideoFrom.videoPlayerOptions, ); - break; case PodVideoPlayerType.vimeoPrivateVideos: await getQualityUrlsFromVimeoPrivateId( playVideoFrom.dataSource!, @@ -277,7 +271,9 @@ class PodGetXVideoController extends _PodGesturesController { ///checkes wether video should be `autoplayed` initially void checkAutoPlayVideo() { WidgetsBinding.instance.addPostFrameCallback((timeStamp) async { - if (autoPlay && (isVideoUiBinded ?? false)) { + // 一些奇怪的图片资源加载异常, 都会导致 isVideoUiBinded 不成功, 这里不再检查, 直接自动播放 + // if (autoPlay && (isVideoUiBinded ?? false)) { + if (autoPlay) { if (kIsWeb) await _videoCtr?.setVolume(0); podVideoStateChanger(PodVideoState.playing); } else { diff --git a/lib/src/pod_player.dart b/lib/src/pod_player.dart index 82f451f8..59baa9dd 100644 --- a/lib/src/pod_player.dart +++ b/lib/src/pod_player.dart @@ -97,8 +97,7 @@ class PodVideoPlayer extends StatefulWidget { State createState() => _PodVideoPlayerState(); } -class _PodVideoPlayerState extends State - with TickerProviderStateMixin { +class _PodVideoPlayerState extends State with TickerProviderStateMixin { late PodGetXVideoController _podCtr; // late String tag; @@ -212,9 +211,9 @@ class _PodVideoPlayerState extends State Widget _buildLoading() { return widget.onLoading?.call(context) ?? - const CircularProgressIndicator( + CircularProgressIndicator( backgroundColor: Colors.black87, - color: Colors.white, + color: Theme.of(context).colorScheme.primary, strokeWidth: 2, ); } diff --git a/lib/src/widgets/animated_play_pause_icon.dart b/lib/src/widgets/animated_play_pause_icon.dart index 0aabdd3a..91fa6d1d 100644 --- a/lib/src/widgets/animated_play_pause_icon.dart +++ b/lib/src/widgets/animated_play_pause_icon.dart @@ -13,8 +13,7 @@ class _AnimatedPlayPauseIcon extends StatefulWidget { State<_AnimatedPlayPauseIcon> createState() => _AnimatedPlayPauseIconState(); } -class _AnimatedPlayPauseIconState extends State<_AnimatedPlayPauseIcon> - with SingleTickerProviderStateMixin { +class _AnimatedPlayPauseIconState extends State<_AnimatedPlayPauseIcon> with SingleTickerProviderStateMixin { late final AnimationController _payCtr; late PodGetXVideoController _podCtr; @override @@ -60,12 +59,9 @@ class _AnimatedPlayPauseIconState extends State<_AnimatedPlayPauseIcon> id: 'podVideoState', builder: (f) => MaterialIconButton( toolTipMesg: f.isvideoPlaying - ? podCtr.podPlayerLabels.pause ?? - 'Pause${kIsWeb ? ' (space)' : ''}' - : podCtr.podPlayerLabels.play ?? - 'Play${kIsWeb ? ' (space)' : ''}', - onPressed: - podCtr.isOverlayVisible ? podCtr.togglePlayPauseVideo : null, + ? podCtr.podPlayerLabels.pause ?? 'Pause${kIsWeb ? ' (space)' : ''}' + : podCtr.podPlayerLabels.play ?? 'Play${kIsWeb ? ' (space)' : ''}', + onPressed: podCtr.isOverlayVisible ? podCtr.togglePlayPauseVideo : null, child: onStateChange(podCtr), ), ); @@ -86,7 +82,8 @@ class _AnimatedPlayPauseIconState extends State<_AnimatedPlayPauseIcon> return AnimatedIcon( icon: AnimatedIcons.play_pause, progress: _payCtr, - color: Colors.white, + // 操作按钮的颜色 + color: Theme.of(context).colorScheme.primary, size: widget.size, ); } diff --git a/lib/src/widgets/core/overlays/mobile_bottomsheet.dart b/lib/src/widgets/core/overlays/mobile_bottomsheet.dart index 5cf988e9..a6c95816 100644 --- a/lib/src/widgets/core/overlays/mobile_bottomsheet.dart +++ b/lib/src/widgets/core/overlays/mobile_bottomsheet.dart @@ -40,9 +40,7 @@ class _MobileBottomSheet extends StatelessWidget { _bottomSheetTiles( title: podCtr.podPlayerLabels.loopVideo, icon: Icons.loop_rounded, - subText: podCtr.isLooping - ? podCtr.podPlayerLabels.optionEnabled - : podCtr.podPlayerLabels.optionDisabled, + subText: podCtr.isLooping ? podCtr.podPlayerLabels.optionEnabled : podCtr.podPlayerLabels.optionDisabled, onTap: () { Navigator.of(context).pop(); podCtr.toggleLooping(); @@ -187,8 +185,8 @@ class _MobileOverlayBottomControlles extends StatelessWidget { @override Widget build(BuildContext context) { - const durationTextStyle = TextStyle(color: Colors.white70); - const itemColor = Colors.white; + final itemColor = Theme.of(context).colorScheme.primary; + final durationTextStyle = TextStyle(color: itemColor); return GetBuilder( tag: tag, @@ -207,9 +205,9 @@ class _MobileOverlayBottomControlles extends StatelessWidget { children: [ Text( podCtr.calculateVideoDuration(podCtr.videoPosition), - style: const TextStyle(color: itemColor), + style: TextStyle(color: itemColor), ), - const Text( + Text( ' / ', style: durationTextStyle, ), @@ -224,10 +222,8 @@ class _MobileOverlayBottomControlles extends StatelessWidget { const Spacer(), MaterialIconButton( toolTipMesg: podCtr.isFullScreen - ? podCtr.podPlayerLabels.exitFullScreen ?? - 'Exit full screen${kIsWeb ? ' (f)' : ''}' - : podCtr.podPlayerLabels.fullscreen ?? - 'Fullscreen${kIsWeb ? ' (f)' : ''}', + ? podCtr.podPlayerLabels.exitFullScreen ?? 'Exit full screen${kIsWeb ? ' (f)' : ''}' + : podCtr.podPlayerLabels.fullscreen ?? 'Fullscreen${kIsWeb ? ' (f)' : ''}', color: itemColor, onPressed: () { if (podCtr.isOverlayVisible) { @@ -241,9 +237,7 @@ class _MobileOverlayBottomControlles extends StatelessWidget { } }, child: Icon( - podCtr.isFullScreen - ? Icons.fullscreen_exit - : Icons.fullscreen, + podCtr.isFullScreen ? Icons.fullscreen_exit : Icons.fullscreen, ), ), ], diff --git a/lib/src/widgets/core/overlays/mobile_overlay.dart b/lib/src/widgets/core/overlays/mobile_overlay.dart index 1afe558d..6bde152e 100644 --- a/lib/src/widgets/core/overlays/mobile_overlay.dart +++ b/lib/src/widgets/core/overlays/mobile_overlay.dart @@ -10,7 +10,6 @@ class _MobileOverlay extends StatelessWidget { @override Widget build(BuildContext context) { const overlayColor = Colors.black38; - const itemColor = Colors.white; final podCtr = Get.find(tag: tag); return Stack( alignment: Alignment.center, @@ -26,9 +25,7 @@ class _MobileOverlay extends StatelessWidget { tag: tag, isForward: false, height: double.maxFinite, - onDoubleTap: _isRtl() - ? podCtr.onRightDoubleTap - : podCtr.onLeftDoubleTap, + onDoubleTap: _isRtl() ? podCtr.onRightDoubleTap : podCtr.onLeftDoubleTap, ), ), SizedBox( @@ -42,9 +39,7 @@ class _MobileOverlay extends StatelessWidget { isForward: true, tag: tag, height: double.maxFinite, - onDoubleTap: _isRtl() - ? podCtr.onLeftDoubleTap - : podCtr.onRightDoubleTap, + onDoubleTap: _isRtl() ? podCtr.onLeftDoubleTap : podCtr.onRightDoubleTap, ), ), ], @@ -57,13 +52,10 @@ class _MobileOverlay extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.end, children: [ Expanded( - child: IgnorePointer( - child: podCtr.videoTitle ?? const SizedBox(), - ), + child: podCtr.videoTitle ?? const SizedBox(), ), MaterialIconButton( toolTipMesg: podCtr.podPlayerLabels.settings, - color: itemColor, onPressed: () { if (podCtr.isOverlayVisible) { _bottomSheet(context); diff --git a/lib/src/widgets/core/overlays/web_overlay.dart b/lib/src/widgets/core/overlays/web_overlay.dart index 3371b2fc..251bdf2b 100644 --- a/lib/src/widgets/core/overlays/web_overlay.dart +++ b/lib/src/widgets/core/overlays/web_overlay.dart @@ -61,7 +61,7 @@ class _WebOverlay extends StatelessWidget { }, ), ), - IgnorePointer(child: podCtr.videoTitle ?? const SizedBox()), + podCtr.videoTitle ?? const SizedBox(), ], ); } @@ -107,16 +107,12 @@ class _WebOverlayBottomControlles extends StatelessWidget { id: 'volume', builder: (podCtr) => MaterialIconButton( toolTipMesg: podCtr.isMute - ? podCtr.podPlayerLabels.unmute ?? - 'Unmute${kIsWeb ? ' (m)' : ''}' - : podCtr.podPlayerLabels.mute ?? - 'Mute${kIsWeb ? ' (m)' : ''}', + ? podCtr.podPlayerLabels.unmute ?? 'Unmute${kIsWeb ? ' (m)' : ''}' + : podCtr.podPlayerLabels.mute ?? 'Mute${kIsWeb ? ' (m)' : ''}', color: itemColor, onPressed: podCtr.toggleMute, child: Icon( - podCtr.isMute - ? Icons.volume_off_rounded - : Icons.volume_up_rounded, + podCtr.isMute ? Icons.volume_off_rounded : Icons.volume_up_rounded, ), ), ), @@ -160,16 +156,12 @@ class _WebOverlayBottomControlles extends StatelessWidget { _WebSettingsDropdown(tag: tag), MaterialIconButton( toolTipMesg: podCtr.isFullScreen - ? podCtr.podPlayerLabels.exitFullScreen ?? - 'Exit full screen${kIsWeb ? ' (f)' : ''}' - : podCtr.podPlayerLabels.fullscreen ?? - 'Fullscreen${kIsWeb ? ' (f)' : ''}', + ? podCtr.podPlayerLabels.exitFullScreen ?? 'Exit full screen${kIsWeb ? ' (f)' : ''}' + : podCtr.podPlayerLabels.fullscreen ?? 'Fullscreen${kIsWeb ? ' (f)' : ''}', color: itemColor, onPressed: () => _onFullScreenToggle(podCtr, context), child: Icon( - podCtr.isFullScreen - ? Icons.fullscreen_exit - : Icons.fullscreen, + podCtr.isFullScreen ? Icons.fullscreen_exit : Icons.fullscreen, ), ), ], diff --git a/lib/src/widgets/core/pod_core_player.dart b/lib/src/widgets/core/pod_core_player.dart index 7a7a3e47..b6cbece1 100644 --- a/lib/src/widgets/core/pod_core_player.dart +++ b/lib/src/widgets/core/pod_core_player.dart @@ -18,9 +18,7 @@ class _PodCoreVideoPlayer extends StatelessWidget { builder: (ctrx) { return RawKeyboardListener( autofocus: true, - focusNode: - (podCtr.isFullScreen ? FocusNode() : podCtr.keyboardFocusWeb) ?? - FocusNode(), + focusNode: (podCtr.isFullScreen ? FocusNode() : podCtr.keyboardFocusWeb) ?? FocusNode(), onKey: (value) => podCtr.onKeyBoardEvents( event: value, appContext: ctrx, @@ -46,8 +44,7 @@ class _PodCoreVideoPlayer extends StatelessWidget { return const SizedBox(); } - if (podCtr.podVideoState == PodVideoState.paused && - podCtr.videoPosition == Duration.zero) { + if (podCtr.podVideoState == PodVideoState.paused && podCtr.videoPosition == Duration.zero) { return SizedBox.expand( child: TweenAnimationBuilder( builder: (context, value, child) => Opacity( @@ -88,11 +85,12 @@ class _PodCoreVideoPlayer extends StatelessWidget { case PodVideoState.loading: return loadingWidget; case PodVideoState.paused: - return const Center( + return Center( child: Icon( Icons.play_arrow, size: 45, - color: Colors.white, + color: Theme.of(context).iconTheme.color, + // color: Colors.white, ), ); case PodVideoState.playing: @@ -104,10 +102,11 @@ class _PodCoreVideoPlayer extends StatelessWidget { ), tween: Tween(begin: 1, end: 0), duration: const Duration(seconds: 1), - child: const Icon( + child: Icon( Icons.pause, size: 45, - color: Colors.white, + color: Theme.of(context).iconTheme.color, + // color: Colors.white, ), ), ); @@ -132,16 +131,14 @@ class _PodCoreVideoPlayer extends StatelessWidget { : GetBuilder( tag: tag, id: 'overlay', - builder: (podCtr) => podCtr.isOverlayVisible || - !podCtr.alwaysShowProgressBar + builder: (podCtr) => podCtr.isOverlayVisible || !podCtr.alwaysShowProgressBar ? const SizedBox() : Align( alignment: Alignment.bottomCenter, child: PodProgressBar( tag: tag, alignment: Alignment.bottomCenter, - podProgressBarConfig: - podCtr.podProgressBarConfig, + podProgressBarConfig: podCtr.podProgressBarConfig, ), ), ), diff --git a/lib/src/widgets/double_tap_icon.dart b/lib/src/widgets/double_tap_icon.dart index 1875e920..b58a0fd9 100644 --- a/lib/src/widgets/double_tap_icon.dart +++ b/lib/src/widgets/double_tap_icon.dart @@ -26,8 +26,7 @@ class DoubleTapIcon extends StatefulWidget { State createState() => _DoubleTapIconState(); } -class _DoubleTapIconState extends State - with SingleTickerProviderStateMixin { +class _DoubleTapIconState extends State with SingleTickerProviderStateMixin { late final AnimationController _animationController; late final Animation opacityCtr; @@ -81,10 +80,8 @@ class _DoubleTapIconState extends State onDoubleTap: _onDoubleTap, rippleColor: Colors.white, wrapper: (parentWidget, curveRadius) { - final forwardRadius = - !widget.isForward ? Radius.zero : Radius.circular(curveRadius); - final backwardRadius = - widget.isForward ? Radius.zero : Radius.circular(curveRadius); + final forwardRadius = !widget.isForward ? Radius.zero : Radius.circular(curveRadius); + final backwardRadius = widget.isForward ? Radius.zero : Radius.circular(curveRadius); return ClipRRect( borderRadius: BorderRadius.only( bottomLeft: forwardRadius, @@ -106,10 +103,11 @@ class _DoubleTapIconState extends State child: AnimatedBuilder( animation: _animationController, builder: (context, child) { - const icon = Icon( + final icon = Icon( Icons.play_arrow_sharp, size: 32, - color: Colors.white, + // color: Colors.white, + color: Theme.of(context).iconTheme.color, ); return Center( child: Column( diff --git a/lib/src/widgets/material_icon_button.dart b/lib/src/widgets/material_icon_button.dart index 6dccb2c1..87d81652 100644 --- a/lib/src/widgets/material_icon_button.dart +++ b/lib/src/widgets/material_icon_button.dart @@ -35,7 +35,7 @@ class MaterialIconButton extends StatelessWidget { child: Padding( padding: EdgeInsets.all(radius), child: IconTheme( - data: IconThemeData(color: color, size: 24), + data: Theme.of(context).iconTheme, child: child, ), ), diff --git a/pubspec.yaml b/pubspec.yaml index c04b2050..0924ea59 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -11,17 +11,18 @@ dependencies: flutter: sdk: flutter # services - video_player: ^2.8.5 - http: ^1.2.1 - get: ^4.6.6 - wakelock_plus: ^1.2.4 - universal_html: ^2.2.4 - youtube_explode_dart: ^2.2.0 + video_player: 2.9.2 + http: 1.2.2 + get: 4.6.6 + wakelock_plus: 1.2.8 + universal_html: 2.2.4 + youtube_explode_dart: + path: ../youtube_explode_dart/ dev_dependencies: flutter_test: sdk: flutter - very_good_analysis: ^5.0.0+1 + very_good_analysis: 6.0.0 screenshots: - description: Pod video player logo