Skip to content

Commit 0d997f8

Browse files
authored
Merge pull request #658 from Geevies/viewerController
Add transformationController to Interactive Viewer
2 parents d19ad61 + 39f8876 commit 0d997f8

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

lib/src/chewie_player.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ class ChewieController extends ChangeNotifier {
262262
this.optionsBuilder,
263263
this.additionalOptions,
264264
this.showControls = true,
265+
this.transformationController,
265266
this.zoomAndPan = false,
266267
this.maxScale = 2.5,
267268
this.subtitle,
@@ -307,6 +308,7 @@ class ChewieController extends ChangeNotifier {
307308
Future<void> Function(BuildContext, List<OptionItem>)? optionsBuilder,
308309
List<OptionItem> Function(BuildContext)? additionalOptions,
309310
bool? showControls,
311+
TransformationController? transformationController,
310312
bool? zoomAndPan,
311313
double? maxScale,
312314
Subtitles? subtitle,
@@ -439,6 +441,9 @@ class ChewieController extends ChangeNotifier {
439441
/// Whether or not to show the controls at all
440442
final bool showControls;
441443

444+
/// Controller to pass into the [InteractiveViewer] component
445+
final TransformationController? transformationController;
446+
442447
/// Whether or not to allow zooming and panning
443448
final bool zoomAndPan;
444449

lib/src/player_with_controls.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ class PlayerWithControls extends StatelessWidget {
3838
if (chewieController.placeholder != null)
3939
chewieController.placeholder!,
4040
InteractiveViewer(
41+
transformationController: chewieController.transformationController,
4142
maxScale: chewieController.maxScale,
4243
panEnabled: chewieController.zoomAndPan,
4344
scaleEnabled: chewieController.zoomAndPan,

0 commit comments

Comments
 (0)