@@ -299,7 +299,8 @@ class AssetPickerViewerState extends State<AssetPickerViewer>
299
299
},
300
300
),
301
301
const Spacer (),
302
- if (provider != null ) selectButton,
302
+ if (isAppleOS && provider != null ) selectButton,
303
+ if (! isAppleOS && provider != null ) confirmButton (context),
303
304
],
304
305
),
305
306
),
@@ -313,44 +314,47 @@ class AssetPickerViewerState extends State<AssetPickerViewer>
313
314
/// 当有资源已选时,点击按钮将把已选资源通过路由返回。
314
315
/// 资源选择器将识别并一同返回。
315
316
Widget confirmButton (BuildContext context) =>
316
- Consumer <AssetPickerViewerProvider >(
317
- builder: (
318
- BuildContext _,
319
- AssetPickerViewerProvider provider,
320
- Widget __,
321
- ) {
322
- return MaterialButton (
323
- minWidth: provider.isSelectedNotEmpty ? 48.0 : 20.0 ,
324
- height: 32.0 ,
325
- padding: const EdgeInsets .symmetric (horizontal: 12.0 ),
326
- color: provider.isSelectedNotEmpty
327
- ? widget.themeData.buttonColor
328
- : widget.themeData.dividerColor,
329
- shape: RoundedRectangleBorder (
330
- borderRadius: BorderRadius .circular (3.0 ),
331
- ),
332
- child: Text (
333
- provider.isSelectedNotEmpty
334
- ? '${Constants .textDelegate .confirm }(${provider .currentlySelectedAssets .length }'
335
- '/'
336
- '${widget .selectorProvider .maxAssets })'
337
- : Constants .textDelegate.confirm,
338
- style: TextStyle (
339
- color: provider.isSelectedNotEmpty
340
- ? Colors .white
341
- : Colors .grey[600 ],
342
- fontSize: 17.0 ,
343
- fontWeight: FontWeight .normal,
317
+ ChangeNotifierProvider <AssetPickerViewerProvider >.value (
318
+ value: provider,
319
+ child: Consumer <AssetPickerViewerProvider >(
320
+ builder: (
321
+ BuildContext _,
322
+ AssetPickerViewerProvider provider,
323
+ Widget __,
324
+ ) {
325
+ return MaterialButton (
326
+ minWidth: provider.isSelectedNotEmpty ? 48.0 : 20.0 ,
327
+ height: 32.0 ,
328
+ padding: const EdgeInsets .symmetric (horizontal: 12.0 ),
329
+ color: provider.isSelectedNotEmpty
330
+ ? widget.themeData.buttonColor
331
+ : widget.themeData.dividerColor,
332
+ shape: RoundedRectangleBorder (
333
+ borderRadius: BorderRadius .circular (3.0 ),
344
334
),
345
- ),
346
- onPressed: () {
347
- if (provider.isSelectedNotEmpty) {
348
- Navigator .of (context).pop (provider.currentlySelectedAssets);
349
- }
350
- },
351
- materialTapTargetSize: MaterialTapTargetSize .shrinkWrap,
352
- );
353
- },
335
+ child: Text (
336
+ provider.isSelectedNotEmpty
337
+ ? '${Constants .textDelegate .confirm }(${provider .currentlySelectedAssets .length }'
338
+ '/'
339
+ '${widget .selectorProvider .maxAssets })'
340
+ : Constants .textDelegate.confirm,
341
+ style: TextStyle (
342
+ color: provider.isSelectedNotEmpty
343
+ ? Colors .white
344
+ : Colors .grey[600 ],
345
+ fontSize: 17.0 ,
346
+ fontWeight: FontWeight .normal,
347
+ ),
348
+ ),
349
+ onPressed: () {
350
+ if (provider.isSelectedNotEmpty) {
351
+ Navigator .of (context).pop (provider.currentlySelectedAssets);
352
+ }
353
+ },
354
+ materialTapTargetSize: MaterialTapTargetSize .shrinkWrap,
355
+ );
356
+ },
357
+ ),
354
358
);
355
359
356
360
/// Thumb item widget in bottom detail.
0 commit comments