We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import 'package:flutter_inappwebview/flutter_inappwebview.dart'; import 'package:window_manager/window_manager.dart'; void main() async { WidgetsFlutterBinding.ensureInitialized(); await windowManager.ensureInitialized(); WindowOptions windowOptions = const WindowOptions( size: Size(800, 600), center: true, backgroundColor: Colors.transparent, skipTaskbar: false, titleBarStyle: TitleBarStyle.normal, windowButtonVisibility: false, ); windowManager.waitUntilReadyToShow(windowOptions, () async { await windowManager.show(); await windowManager.focus(); }); runApp(const MyApp()); } class MyApp extends StatefulWidget { const MyApp({super.key}); @override State<MyApp> createState() => _MyAppState(); } class _MyAppState extends State<MyApp> { ThemeMode _themeMode = ThemeMode.light; InAppWebViewController? webViewController; String url = ""; double progress = 0; final urlController = TextEditingController(); @override void initState() { super.initState(); } @override void dispose() { super.dispose(); } @override Widget build(BuildContext context) { final virtualWindowFrameBuilder = VirtualWindowFrameInit(); return MaterialApp( debugShowCheckedModeBanner: false, themeMode: _themeMode, builder: (context, child) { child = virtualWindowFrameBuilder(context, child); return child; }, home: Scaffold( appBar: PreferredSize( preferredSize: const Size.fromHeight(40), child: SizedBox( width: 1060, child: Row( children: [ const Expanded( child: DragWindow(), ), /// 右上角按钮 Row(children: [ IconButton( onPressed: () async{ await windowManager.minimize(); }, icon: const Icon(Icons.remove)), IconButton( onPressed: () async{ await windowManager.close(); }, icon: const Icon(Icons.close)), ]) ], ), )), body: SafeArea( child: Column(children: <Widget>[ TextField( decoration: const InputDecoration(prefixIcon: Icon(Icons.search)), controller: urlController, keyboardType: TextInputType.url, onSubmitted: (value) { var url = WebUri(value); if (url.scheme.isEmpty) { url = WebUri("https://www.google.com/search?q=$value"); } webViewController?.loadUrl(urlRequest: URLRequest(url: url)); }, ), Expanded( child: Stack( children: [ InAppWebView( initialUrlRequest: URLRequest(url: WebUri("https://inappwebview.dev/")), onWebViewCreated: (controller) { webViewController = controller; }, onLoadStart: (controller, url) { setState(() { this.url = url.toString(); urlController.text = this.url; }); }, ), progress < 1.0 ? LinearProgressIndicator(value: progress) : Container(), ], ), ), ButtonBar( alignment: MainAxisAlignment.center, children: <Widget>[ ElevatedButton( child: const Icon(Icons.arrow_back), onPressed: () { webViewController?.goBack(); }, ), ElevatedButton( child: const Icon(Icons.arrow_forward), onPressed: () { webViewController?.goForward(); }, ), ElevatedButton( child: const Icon(Icons.refresh), onPressed: () { webViewController?.reload(); }, ), ], ), ])), )); } } //拖动窗口 class DragWindow extends StatelessWidget { const DragWindow({super.key}); @override Widget build(BuildContext context) { return SizedBox( child: Listener( onPointerDown: (event) async { await windowManager.startDragging(); }, child: Container( color: Colors.transparent, ), ), ); } }
After minimizing the window, the mouse cannot interact with the desktop, and the minimize method does not hide the webview page
Flutter version:3.24.3 Version of plugin used:0.4.3 Other plugins used:flutter_inappwebview: ^6.2.0-beta.2
The text was updated successfully, but these errors were encountered:
No branches or pull requests
After minimizing the window, the mouse cannot interact with the desktop, and the minimize method does not hide the webview page
Flutter version:3.24.3
Version of plugin used:0.4.3
Other plugins used:flutter_inappwebview: ^6.2.0-beta.2
The text was updated successfully, but these errors were encountered: