linux_webview 0.0.1 copy "linux_webview: ^0.0.1" to clipboard
linux_webview: ^0.0.1 copied to clipboard

retracted[pending analysis]

Webview rendering on Linux using GTK

example/lib/main.dart

import 'package:flutter/material.dart';
import 'dart:ffi' as ffi;

typedef CreateCytoscapeViewNative = ffi.Void Function();
typedef CreateCytoscapeView = void Function();

void showCytoscapeView() {
  // Open the dynamic library (ensure the library path is correct)
  final dylib = ffi.DynamicLibrary.open('libyourrustcrate.so');
  
  // Look up the 'create_cytoscape_webview' function from the Rust library
  final createWebview = dylib
      .lookup<ffi.NativeFunction<CreateCytoscapeViewNative>>('create_cytoscape_webview')
      .asFunction<CreateCytoscapeView>();

  // Call the function to show the WebView
  createWebview();
}

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text('Cytoscape WebView'),
        ),
        body: Center(
          child: ElevatedButton(
            onPressed: () {
              // When the button is pressed, invoke the Rust code to show the WebView
              showCytoscapeView();
            },
            child: Text('Show Cytoscape WebView'),
          ),
        ),
      ),
    );
  }
}
0
likes
0
points
17
downloads

Publisher

unverified uploader

Weekly Downloads

Webview rendering on Linux using GTK

Repository (GitHub)
View/report issues

License

(pending) (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on linux_webview