diff --git a/README.md b/README.md index 576e8ff..36d8278 100644 --- a/README.md +++ b/README.md @@ -150,7 +150,6 @@ I used this project to test the capabilities of the following technologies: * CC in Expanded Controls (iOS) * Expanded Controls cosmetics (ad in progress bar, full screen, progress bar handle) -* Handle mini-player * Handle queue * Handle progress seek * Understand if it is better to refactor using streams instead of listeners \ No newline at end of file diff --git a/example/lib/main.dart b/example/lib/main.dart index 6bde48f..21929f0 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -177,6 +177,7 @@ class _MyAppState extends State { padding: const EdgeInsets.symmetric(vertical: 8.0), child: MiniController( castFramework: castFramework, + onControllerTapped: _openExpandedControls, ), ), ], diff --git a/lib/src/cast/widgets/mini_controller/MiniController.dart b/lib/src/cast/widgets/mini_controller/MiniController.dart index acb6efe..af9824a 100644 --- a/lib/src/cast/widgets/mini_controller/MiniController.dart +++ b/lib/src/cast/widgets/mini_controller/MiniController.dart @@ -8,9 +8,15 @@ import 'MiniControllerPlayPauseButton.dart'; class MiniController extends StatelessWidget { final FlutterCastFramework castFramework; + /// This is called when the mini controller is tapped and the tap is not + /// handled by the controller. Generally, you want to open the expanded controls + /// on this callback. + final VoidCallback? onControllerTapped; + const MiniController({ Key? key, required this.castFramework, + this.onControllerTapped, }) : super(key: key); Widget _getControls(MediaStatus? status) { @@ -38,24 +44,28 @@ class MiniController extends StatelessWidget { status: status, ); - return SizedBox( - height: 60, - child: Row( - children: [ - thumbnail, - Container(width: 12), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - title, - subtitle, - ], + return InkWell( + onTap: onControllerTapped, + child: SizedBox( + height: 60, + child: Row( + children: [ + thumbnail, + Container(width: 12), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + title, + subtitle, + ], + ), ), - ), - playPauseButton, - ], + // ), + playPauseButton, + ], + ), ), ); }