Skip to content

Commit 3dac4b8

Browse files
author
stones
committed
fix display size while Chewie wrapped by some rotate widget
1 parent 015a986 commit 3dac4b8

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

lib/src/player_with_controls.dart

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,18 @@ class PlayerWithControls extends StatelessWidget {
8383
);
8484
}
8585

86-
return Center(
87-
child: SizedBox(
88-
height: MediaQuery.of(context).size.height,
89-
width: MediaQuery.of(context).size.width,
90-
child: AspectRatio(
91-
aspectRatio: calculateAspectRatio(context),
92-
child: buildPlayerWithControls(chewieController, context),
86+
return LayoutBuilder(
87+
builder: (BuildContext context, BoxConstraints constraints) {
88+
return Center(
89+
child: SizedBox(
90+
height: constraints.maxHeight,
91+
width: constraints.maxWidth,
92+
child: AspectRatio(
93+
aspectRatio: calculateAspectRatio(context),
94+
child: buildPlayerWithControls(chewieController, context),
95+
),
9396
),
94-
),
95-
);
97+
);
98+
});
9699
}
97100
}

0 commit comments

Comments
 (0)