open_file_web 0.0.3 copy "open_file_web: ^0.0.3" to clipboard
open_file_web: ^0.0.3 copied to clipboard

Platformweb

web implementation of the open_file plugin.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:open_file_web/open_file_web.dart';

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

class MyApp extends StatefulWidget {
  const MyApp({super.key});

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

class _MyAppState extends State<MyApp> {
  final _openFile = OpenFilePlugin();
  String _result = "click to open file";

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: GestureDetector(child: Text(_result),onTap: ()async{
            final resultType = await _openFile.open("./icons/Icon-192.png");

            setState(() {
              _result = resultType.message;
            });
          },),
        ),
      ),
    );
  }
}
0
likes
150
pub points
89%
popularity

Publisher

unverified uploader

web implementation of the open_file plugin.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter, flutter_web_plugins, open_file_platform_interface, web

More

Packages that depend on open_file_web