mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-11-21 20:00:49 +01:00
FlutterView.display throws a null check error when the engine has replaced its display list and the view does not yet name one of the new displays, which happens while a window is dragged on Windows. Every read of the display now goes through displayOf, which gives null in that case. Fixes #930
13 lines
281 B
Dart
13 lines
281 B
Dart
import 'dart:ui';
|
|
|
|
/// The display [view] is on, or null. [FlutterView.display] throws while a
|
|
/// desktop window moves between screens.
|
|
Display? displayOf(FlutterView? view) {
|
|
if (view == null) return null;
|
|
try {
|
|
return view.display;
|
|
} on Error {
|
|
return null;
|
|
}
|
|
}
|