webview_win_floating 1.0.4 copy "webview_win_floating: ^1.0.4" to clipboard
webview_win_floating: ^1.0.4 copied to clipboard

PlatformWindows

WebView for Windows. A Flutter plugin that implements the interface of package webview_flutter.

example/lib/main.dart

import 'dart:io';

import 'package:flutter/material.dart';
import 'package:webview_win_floating/webview.dart';
import 'package:webview_flutter/webview_flutter.dart';

void main() {
  if (Platform.isWindows) WebView.platform = WindowsWebViewPlugin();
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
  }

  late WebViewController controller;
  final srollController = ScrollController();
  @override
  Widget build(BuildContext context) {
    Widget webview = WebView(
      initialUrl: "https://www.youtube.com/",
      javascriptMode: JavascriptMode.unrestricted,
      onWebViewCreated: (controller) {
        this.controller = controller;
      },
    );

    webview = SingleChildScrollView(
      //scrollDirection: Axis.horizontal,
      controller: srollController,
      child: Column(children: [
        SizedBox(
            width: 300, height: 300, child: Container(color: Colors.redAccent)),
        SizedBox(width: 300, height: 300, child: webview),
        SizedBox(
            width: 300,
            height: 300,
            child: Container(color: Colors.greenAccent)),
      ]),
    );

    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Windows Webview example app'),
        ),
        body: webview,
      ),
    );
  }
}
14
likes
120
pub points
86%
popularity

Publisher

unverified uploader

WebView for Windows. A Flutter plugin that implements the interface of package webview_flutter.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

flutter, fullscreen_window, plugin_platform_interface, webview_flutter_platform_interface

More

Packages that depend on webview_win_floating