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

outdated

A new flutter plugin project.

example/lib/main.dart

import 'dart:io';

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

import 'package:flutter/services.dart';
import 'package:images_picker/images_picker.dart';

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

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

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

  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Column(
          children: [
            Text('Running on: $_platformVersion\n'),
            RaisedButton(
              child: Text('pick'),
              onPressed: ()async {
                List<Media> res = await ImagesPicker.pick(
                  count: 2,
                  pickType: PickType.video
                );
                if (res!=null) {
                  print(res[0]?.path);
                  print(res[1]?.path);
//                  setState(() {
//                    path = res[0]?.path;
//                  });
                }
              },
            ),
            RaisedButton(
              child: Text('openCamera'),
              onPressed: ()async {
                List<Media> res = await ImagesPicker.openCamera(
                  pickType: PickType.video,
                );
                if (res!=null) print(res[0]?.path);
//                setState(() {
//                  if (res!=null)path = res[0]?.path;
//                });
              },
            ),
            path!=null?Image.file(File(path)):SizedBox.shrink(),
          ],
        ),
      ),
    );
  }
}
186
likes
0
pub points
96%
popularity

Publisher

verified publisherchavesgu.com

A new flutter plugin project.

Homepage

License

unknown (license)

Dependencies

flutter

More

Packages that depend on images_picker