fix: Avoid using MediaQuery.of()
This commit is contained in:
parent
92c5549f74
commit
d2c2fd48d4
13 changed files with 20 additions and 21 deletions
|
|
@ -238,18 +238,18 @@ class MyCallingPage extends State<Calling> {
|
|||
|
||||
void _resizeLocalVideo(Orientation orientation) {
|
||||
final shortSide = min(
|
||||
MediaQuery.of(widget.context).size.width,
|
||||
MediaQuery.of(widget.context).size.height,
|
||||
MediaQuery.sizeOf(widget.context).width,
|
||||
MediaQuery.sizeOf(widget.context).height,
|
||||
);
|
||||
_localVideoMargin = remoteStream != null
|
||||
? const EdgeInsets.only(top: 20.0, right: 20.0)
|
||||
: EdgeInsets.zero;
|
||||
_localVideoWidth = remoteStream != null
|
||||
? shortSide / 3
|
||||
: MediaQuery.of(widget.context).size.width;
|
||||
: MediaQuery.sizeOf(widget.context).width;
|
||||
_localVideoHeight = remoteStream != null
|
||||
? shortSide / 4
|
||||
: MediaQuery.of(widget.context).size.height;
|
||||
: MediaQuery.sizeOf(widget.context).height;
|
||||
}
|
||||
|
||||
void _handleCallState(CallState state) {
|
||||
|
|
|
|||
|
|
@ -138,10 +138,9 @@ class PIPViewState extends State<PIPView> with TickerProviderStateMixin {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final mediaQuery = MediaQuery.of(context);
|
||||
var windowPadding = mediaQuery.padding;
|
||||
var windowPadding = MediaQuery.paddingOf(context);
|
||||
if (widget.avoidKeyboard) {
|
||||
windowPadding += mediaQuery.viewInsets;
|
||||
windowPadding += MediaQuery.viewInsetsOf(context);
|
||||
}
|
||||
final isFloating = _floating;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue