Skip to content

Commit

Permalink
example: use media query
Browse files Browse the repository at this point in the history
Signed-off-by: 21pages <[email protected]>
  • Loading branch information
21pages committed Oct 12, 2023
1 parent c498314 commit 3865a99
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ class _MyAppState extends State<MyApp> with WindowListener {
@override
Widget build(BuildContext context) {
bool isSingleItem = _count == 1;
final size = MediaQuery.of(context).size;
final screenWidth = size.width;
final screenHeight = size.height;
return MaterialApp(
home: Scaffold(
appBar: AppBar(
Expand Down Expand Up @@ -84,8 +87,8 @@ class _MyAppState extends State<MyApp> with WindowListener {
(index) => Padding(
padding: EdgeInsets.all(isSingleItem ? 0 : 5),
child: SizedBox(
width: 2880,
height: 1800,
width: screenWidth,
height: screenHeight,
child: VideoOutput(
plugin: _flutterGpuTextureRendererPlugin,
pluginlib: _pluginLib,
Expand Down

0 comments on commit 3865a99

Please sign in to comment.