location_option.dart 778 B

1234567891011121314151617181920212223242526272829
  1. class LocationOption {
  2. bool isOnceLocation;
  3. bool isNeedAddress;
  4. bool mockEnable;
  5. int locationInterval;
  6. int locationTimeOut;
  7. LocationMode locationMode;
  8. LocationOption(
  9. {this.isOnceLocation = true,
  10. this.isNeedAddress = true,
  11. this.mockEnable = false,
  12. this.locationInterval = 2000,
  13. this.locationTimeOut = 30000,
  14. this.locationMode = LocationMode.Hight_Accuracy});
  15. Map<String, dynamic> toMap() {
  16. return {
  17. "isOnceLocation": isOnceLocation,
  18. "isNeedAddress": isNeedAddress,
  19. "mockEnable": mockEnable,
  20. "locationInterval": locationInterval,
  21. "locationTimeOut": locationTimeOut,
  22. "locationMode": locationMode.index,
  23. };
  24. }
  25. }
  26. enum LocationMode { Battery_Saving, Device_Sensors, Hight_Accuracy }