Skip to content

Instantly share code, notes, and snippets.

@AyushBherwani1998
Created June 30, 2020 12:25
Show Gist options
  • Select an option

  • Save AyushBherwani1998/d76e89b31109de5ecb79b722ab399605 to your computer and use it in GitHub Desktop.

Select an option

Save AyushBherwani1998/d76e89b31109de5ecb79b722ab399605 to your computer and use it in GitHub Desktop.
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()
],
),
),
);
}
}
@AyushBherwani1998
Copy link
Author

AyushBherwani1998 commented Jun 30, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment