open_file_linux 1.1.0
open_file_linux: ^1.1.0 copied to clipboard
Linux platform implementation of open_file
import 'package:flutter/material.dart';
import 'package:open_file_linux/open_file_linux.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 _openFileLinuxPlugin = OpenFileLinux();
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 _openFileLinuxPlugin.open("/home/parallels/Downloads/c53c258fdd13ae138df5c6ff7aaa8e35.jpeg");
setState(() {
_result = resultType.message;
});
},),
),
),
);
}
}