Created
June 30, 2020 12:25
-
-
Save AyushBherwani1998/d76e89b31109de5ecb79b722ab399605 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'dart:io'; | |
| import 'package:flutter/material.dart'; | |
| import 'package:image_picker/image_picker.dart'; | |
| void main() => runApp(MaterialApp( | |
| home: MyApp(), | |
| )); | |
| class MyApp extends StatefulWidget { | |
| @override | |
| _MyAppState createState() => _MyAppState(); | |
| } | |
| class _MyAppState extends State<MyApp> { | |
| File file; | |
| @override | |
| Widget build(BuildContext context) { | |
| return Scaffold( | |
| appBar: AppBar( | |
| title: Text('MyApp'), | |
| ), | |
| body: Center( | |
| child: Column( | |
| mainAxisAlignment: MainAxisAlignment.spaceEvenly, | |
| children: [ | |
| RaisedButton( | |
| onPressed: () => | |
| ImagePicker.pickVideo(source: ImageSource.gallery).then( | |
| (value) => setState(() => file = value), | |
| ), | |
| child: Text('Pick Video'), | |
| ), | |
| file != null ? Text(file.path) : SizedBox.shrink() | |
| ], | |
| ), | |
| ), | |
| ); | |
| } | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Issue: flutter/flutter#42315
The issue is reproducible if I select the Video from files, it returns with the correct file extension. When selecting the video from Google photos, it returns with .jpg extensions. Photos of both have been shared with Taha.
There are dups too, in which Taha and VladyslavBondarenko are already mentioned.
Image picker version used 0.6.7+2