@@ -85,13 +85,14 @@ class _MyHomePageState extends State<MyHomePage> {
85
85
await _playVideo (file);
86
86
} else {
87
87
await _displayPickImageDialog (context! ,
88
- (double ? maxWidth, double ? maxHeight, int ? quality) async {
88
+ (double ? maxWidth, double ? maxHeight, int ? quality, bool forceFullMetadata ) async {
89
89
try {
90
90
final pickedFile = await _picker.getImage (
91
91
source: source,
92
92
maxWidth: maxWidth,
93
93
maxHeight: maxHeight,
94
94
imageQuality: quality,
95
+ forceFullMetadata: forceFullMetadata,
95
96
);
96
97
setState (() {
97
98
_imageFile = pickedFile;
@@ -305,60 +306,72 @@ class _MyHomePageState extends State<MyHomePage> {
305
306
return showDialog (
306
307
context: context,
307
308
builder: (context) {
308
- return AlertDialog (
309
- title: Text ('Add optional parameters' ),
310
- content: Column (
311
- children: < Widget > [
312
- TextField (
313
- controller: maxWidthController,
314
- keyboardType: TextInputType .numberWithOptions (decimal: true ),
315
- decoration:
316
- InputDecoration (hintText: "Enter maxWidth if desired" ),
317
- ),
318
- TextField (
319
- controller: maxHeightController,
320
- keyboardType: TextInputType .numberWithOptions (decimal: true ),
321
- decoration:
322
- InputDecoration (hintText: "Enter maxHeight if desired" ),
323
- ),
324
- TextField (
325
- controller: qualityController,
326
- keyboardType: TextInputType .number,
327
- decoration:
328
- InputDecoration (hintText: "Enter quality if desired" ),
329
- ),
330
- ],
331
- ),
332
- actions: < Widget > [
333
- TextButton (
334
- child: const Text ('CANCEL' ),
335
- onPressed: () {
336
- Navigator .of (context).pop ();
337
- },
309
+ bool forceFullMetadata = true ;
310
+ return StatefulBuilder (builder: (context, setState) {
311
+ return AlertDialog (
312
+ title: Text ('Add optional parameters' ),
313
+ content: Column (
314
+ children: < Widget > [
315
+ TextField (
316
+ controller: maxWidthController,
317
+ keyboardType: TextInputType .numberWithOptions (decimal: true ),
318
+ decoration:
319
+ InputDecoration (hintText: "Enter maxWidth if desired" ),
320
+ ),
321
+ TextField (
322
+ controller: maxHeightController,
323
+ keyboardType: TextInputType .numberWithOptions (decimal: true ),
324
+ decoration:
325
+ InputDecoration (hintText: "Enter maxHeight if desired" ),
326
+ ),
327
+ TextField (
328
+ controller: qualityController,
329
+ keyboardType: TextInputType .number,
330
+ decoration:
331
+ InputDecoration (hintText: "Enter quality if desired" ),
332
+ ),
333
+ CheckboxListTile (
334
+ value: forceFullMetadata,
335
+ onChanged: (bool ? value) {
336
+ setState (() {
337
+ forceFullMetadata = value ?? false ;
338
+ });
339
+ },
340
+ title: Text ("Force full metadata" ),
341
+ )
342
+ ],
338
343
),
339
- TextButton (
340
- child: const Text ('PICK' ),
344
+ actions: < Widget > [
345
+ TextButton (
346
+ child: const Text ('CANCEL' ),
341
347
onPressed: () {
342
- double ? width = maxWidthController.text.isNotEmpty
343
- ? double .parse (maxWidthController.text)
344
- : null ;
345
- double ? height = maxHeightController.text.isNotEmpty
346
- ? double .parse (maxHeightController.text)
347
- : null ;
348
- int ? quality = qualityController.text.isNotEmpty
349
- ? int .parse (qualityController.text)
350
- : null ;
351
- onPick (width, height, quality);
352
348
Navigator .of (context).pop ();
353
- }),
354
- ],
355
- );
349
+ },
350
+ ),
351
+ TextButton (
352
+ child: const Text ('PICK' ),
353
+ onPressed: () {
354
+ double ? width = maxWidthController.text.isNotEmpty
355
+ ? double .parse (maxWidthController.text)
356
+ : null ;
357
+ double ? height = maxHeightController.text.isNotEmpty
358
+ ? double .parse (maxHeightController.text)
359
+ : null ;
360
+ int ? quality = qualityController.text.isNotEmpty
361
+ ? int .parse (qualityController.text)
362
+ : null ;
363
+ onPick (width, height, quality, forceFullMetadata);
364
+ Navigator .of (context).pop ();
365
+ }),
366
+ ],
367
+ );
368
+ });
356
369
});
357
370
}
358
371
}
359
372
360
373
typedef void OnPickImageCallback (
361
- double ? maxWidth, double ? maxHeight, int ? quality);
374
+ double ? maxWidth, double ? maxHeight, int ? quality, bool forceFullMetadata );
362
375
363
376
class AspectRatioVideo extends StatefulWidget {
364
377
AspectRatioVideo (this .controller);
0 commit comments