From 3865a99f60a92bea4d95bb5d55cf524b1bcbbf5a Mon Sep 17 00:00:00 2001 From: 21pages Date: Thu, 12 Oct 2023 08:58:06 +0800 Subject: [PATCH] example: use media query Signed-off-by: 21pages --- example/lib/main.dart | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/example/lib/main.dart b/example/lib/main.dart index cd7344b..3623a03 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -48,6 +48,9 @@ class _MyAppState extends State 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( @@ -84,8 +87,8 @@ class _MyAppState extends State 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,