album_engine.dart 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. // import 'package:flutter/material.dart';
  2. // import 'package:flutter/services.dart';
  3. // import 'package:get/get.dart';
  4. // import 'package:wechat_assets_picker/wechat_assets_picker.dart';
  5. //
  6. // /*
  7. // * 本地图库的引擎封装,目前用的 wechat_assets_picker 插件
  8. // */
  9. // class AlbumEngine {
  10. // /// 选择图片
  11. // static Future<List<AssetEntity>?> selectImage(
  12. // BuildContext context, {
  13. // int maxAssets = 9,
  14. // List<AssetEntity>? selected,
  15. // int filterMinWidth = 100,
  16. // int filterMaxWidth = 100000,
  17. // int filterMinHeight = 100,
  18. // int filterMaxHeight = 100000,
  19. // }) async {
  20. // FilterOptionGroup filterOptions = FilterOptionGroup()
  21. // ..setOption(
  22. // AssetType.image,
  23. // FilterOption(
  24. // sizeConstraint: SizeConstraint(
  25. // minWidth: filterMinWidth,
  26. // maxWidth: filterMaxWidth,
  27. // minHeight: filterMinHeight,
  28. // maxHeight: filterMaxHeight,
  29. // ),
  30. // ),
  31. // );
  32. //
  33. // return AssetPicker.pickAssets(
  34. // context,
  35. // pickerConfig: AssetPickerConfig(
  36. // requestType: RequestType.image,
  37. // selectedAssets: selected,
  38. // maxAssets: maxAssets,
  39. // filterOptions: filterOptions,
  40. // gridCount: 4,
  41. // pageSize: 40,
  42. // pickerTheme: ThemeData(
  43. // brightness: Brightness.dark,
  44. // appBarTheme: AppBarTheme(
  45. // systemOverlayStyle: SystemUiOverlayStyle.dark.copyWith(
  46. // statusBarColor: Colors.transparent,
  47. // statusBarBrightness: Brightness.dark,
  48. // statusBarIconBrightness: Brightness.light,
  49. // ),
  50. // ),
  51. // ),
  52. // ),
  53. // );
  54. // }
  55. //
  56. // /// 选择视频
  57. // static Future<List<AssetEntity>?> selectVideo(
  58. // BuildContext context, {
  59. // int maxAssets = 1,
  60. // List<AssetEntity>? selected,
  61. // int filterMinWidth = 100,
  62. // int filterMaxWidth = 100000,
  63. // int filterMinHeight = 100,
  64. // int filterMaxHeight = 100000,
  65. // int filterMaxSeconds = 60, //默认能选择60秒以内的视频
  66. // }) async {
  67. // FilterOptionGroup filterOptions = FilterOptionGroup()
  68. // ..setOption(
  69. // AssetType.video,
  70. // FilterOption(
  71. // sizeConstraint: SizeConstraint(
  72. // minWidth: filterMinWidth,
  73. // maxWidth: filterMaxWidth,
  74. // minHeight: filterMinHeight,
  75. // maxHeight: filterMaxHeight,
  76. // ),
  77. // durationConstraint: DurationConstraint(max: Duration(seconds: filterMaxSeconds))),
  78. // );
  79. //
  80. // return AssetPicker.pickAssets(
  81. // context,
  82. // pickerConfig: AssetPickerConfig(
  83. // requestType: RequestType.video,
  84. // selectedAssets: selected,
  85. // maxAssets: maxAssets,
  86. // filterOptions: filterOptions,
  87. // gridCount: 4,
  88. // pageSize: 40,
  89. // pickerTheme: ThemeData(
  90. // brightness: Brightness.dark,
  91. // appBarTheme: AppBarTheme(
  92. // systemOverlayStyle: SystemUiOverlayStyle.dark.copyWith(
  93. // statusBarColor: Colors.transparent,
  94. // statusBarBrightness: Brightness.dark,
  95. // statusBarIconBrightness: Brightness.light,
  96. // ),
  97. // ),
  98. // ),
  99. // ),
  100. // );
  101. // }
  102. // }