open_file 1.0.0 copy "open_file: ^1.0.0" to clipboard
open_file: ^1.0.0 copied to clipboard

outdatedDart 1 only

A new Flutter project.

example/lib/main.dart

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

import 'package:open_file/open_file.dart';

void main() => runApp(new MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => new _MyAppState();
}

class _MyAppState extends State<MyApp> {
  String _platformVersion = 'Unknown';

  @override
  void initState() {
    super.initState();
    openFile("/sdcard/Download/Translate.apk").then((_result){
      setState(() {
        _platformVersion = _result;
      });
    });
  }

  Future<String> openFile(filePath)async{
    return await OpenFile.open(filePath);
  }

  @override
  Widget build(BuildContext context) {

    return new MaterialApp(
      home: new Scaffold(
        appBar: new AppBar(
          title: const Text('Plugin example app'),
        ),
        body: new Center(
          child: new Text('Running on: $_platformVersion\n'),
        ),
      ),
    );
  }
}
869
likes
0
pub points
99%
popularity

Publisher

unverified uploader

A new Flutter project.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on open_file