openInspectorInNewWindow method
Opens the inspector in a new window (applicable only on desktop platforms).
Implementation
Future<void> openInspectorInNewWindow() async {
if (!kIsWeb && Platform.isWindows || Platform.isLinux || Platform.isMacOS) {
/// If a sub window is already open, return.
List<int> subWindowIds = [];
try {
subWindowIds = await DesktopMultiWindow.getAllSubWindowIds();
} catch (_) {}
if (subWindowIds.isNotEmpty) return;
final WindowController window = await DesktopMultiWindow.createWindow(
jsonEncode({'args1': 'Sub window'}),
);
window
..setFrame(const Offset(0, 0) & const Size(1280, 720))
..center()
..setTitle('Infospect');
window.show().then((value) {
Infospect.instance
..sendNetworkCalls()
..sendLogs()
..sendThemeMode(isDarkTheme: isDarkTheme);
});
}
}