class LocationOption { bool isOnceLocation; bool isNeedAddress; bool mockEnable; int locationInterval; int locationTimeOut; LocationMode locationMode; LocationOption( {this.isOnceLocation = true, this.isNeedAddress = true, this.mockEnable = false, this.locationInterval = 2000, this.locationTimeOut = 30000, this.locationMode = LocationMode.Hight_Accuracy}); Map toMap() { return { "isOnceLocation": isOnceLocation, "isNeedAddress": isNeedAddress, "mockEnable": mockEnable, "locationInterval": locationInterval, "locationTimeOut": locationTimeOut, "locationMode": locationMode.index, }; } } enum LocationMode { Battery_Saving, Device_Sensors, Hight_Accuracy }