mnmbase 0.0.2 mnmbase: ^0.0.2 copied to clipboard
A new flutter plugin project.
import 'package:flutter/material.dart';
import 'dart:async';
import 'package:mnmbase/mnmbase.dart';
void main() => runApp(MyApp());
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
final List<StreamSubscription> _subscriptions = [];
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Plugin example app'),
),
body: Center(
child: Column(
children: <Widget>[
RaisedButton(
child: Text('Pick Image'),
onPressed: () async {
final path = await MNMBase.pickImage();
print(path);
},
),
RaisedButton(
child: Text('Pick Document'),
onPressed: () async {
final path = await MNMBase.pickDocument();
print(path);
},
),
RaisedButton(
child: Text('Pick Document With Images'),
onPressed: () async {
final path = await MNMBase.pickDocumentWithImage();
print(path);
},
),
RaisedButton(
child: Text('Pick Video'),
onPressed: () async {
final path = await MNMBase.pickVideo();
print(path);
},
),
],
),
),
),
);
}
@override
void dispose() {
_subscriptions.forEach((s) => s.cancel());
super.dispose();
}
}