Last active
July 18, 2021 09:27
-
-
Save melodysdreamj/2c239ec0c18eb2f7a9be99fa15e49a86 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Future<Size> mediaQuerySizeByCodingPapa(BuildContext context) async{ | |
Size size = MediaQuery.of(context).size; | |
if(size.width > 0){ | |
return size; | |
}else{ | |
await Future.delayed(Duration(milliseconds: 100)); | |
return await mediaQuerySizeByCodingPapa(context); | |
} | |
} |
ㄱㅅㄱㅅ
감사합니다
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
사용할때는 이런식으로..
var deviceW = (await mediaQuerySizeByCodingPapa(context)).width;