Nav apraksta

photo.dart 1.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. library photo;
  2. import 'package:flutter/material.dart';
  3. import 'package:photo_manager/photo_manager.dart';
  4. import 'package:photo/src/entity/options.dart';
  5. /// A Calculator.
  6. class PhotoPicker {
  7. static PhotoPicker _instance;
  8. PhotoPicker._();
  9. factory PhotoPicker() {
  10. _instance ??= PhotoPicker._();
  11. return _instance;
  12. }
  13. void pickImage({
  14. @required BuildContext context,
  15. int rowCount = 3,
  16. int maxSelected = 9,
  17. double padding = 0.5,
  18. Color themeColor,
  19. Color dividerColor,
  20. Color textColor,
  21. Color paddingColor,
  22. }) {
  23. themeColor ??= Theme.of(context)?.primaryColor ?? Colors.black;
  24. dividerColor ??= Theme.of(context)?.dividerColor ?? Colors.grey;
  25. paddingColor ??= Theme.of(context)?.dividerColor ?? Colors.grey;
  26. textColor ??= Colors.white;
  27. Options(
  28. rowCount: rowCount,
  29. dividerColor: dividerColor,
  30. maxSelected: maxSelected,
  31. padding: padding,
  32. paddingColor: paddingColor,
  33. textColor: textColor,
  34. themeColor: themeColor,
  35. );
  36. }
  37. }