Dms class

A default implementation for DmsFormat abstract base class, that defines methods for parsing and formatting degrees/minutes/seconds on latitude, longitude and bearing values.

Inheritance

Constructors

Dms({DmsType type = DmsType.deg, String separator = '', int? decimals, bool signedDegrees = false, bool zeroPadDegrees = false, bool zeroPadMinSec = true, String degree = '°', String prime = '′', String doublePrime = '″'})
Creates a new formatter for parsing and formatting degrees/minutes/seconds on latitude, longitude and bearing values.
const
Dms.narrowSpace({DmsType type = DmsType.deg, int? decimals, bool signedDegrees = false, bool zeroPadDegrees = false, bool zeroPadMinSec = true, String degree = '°', String prime = '′', String doublePrime = '″'})
Creates a new formatter for parsing and formatting degrees/minutes/seconds on latitude, longitude and bearing.
const
Dms.numeric({DmsType type = DmsType.deg, String separator = '\u202f', int? decimals, bool zeroPadDegrees = false, bool zeroPadMinSec = true})
Creates a new formatter for parsing and formatting degrees/minutes/seconds on latitude, longitude and bearing.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

bearing(double deg) String
Converts a degree value deg to a String representation (deg/min/sec) of the bearing (3-digit degrees, 0°..360°) according to the specified type.
override
compassPoint(double bearing, {CardinalPrecision precision = CardinalPrecision.secondaryIntercardinal}) String
Returns the compass point for bearing on the given precision.
inherited
copyWith({DmsType? type, String? separator, int? decimals, bool? signedDegrees, bool? zeroPadDegrees, bool? zeroPadMinSec, String? degree, String? prime, String? doublePrime}) Dms
Copy a new formatter from this with given attributes changed.
format(double deg, {bool twoDigitDeg = false}) String
Converts the degree value deg to a String representation (deg/min/sec) according to the specified type.
override
lat(double deg) String
Converts a degree value deg to a String representation (deg/min/sec) of the latitude (2-digit degrees, suffixed with N/S) according to the specified type.
override
lon(double deg) String
Converts a degree value deg to a String representation (deg/min/sec) of the longitude (3-digit degrees, suffixed with E/W) according to the specified type.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
parse(String dms) double
Parses a string dms representing degrees/minutes/seconds into a numeric degree value (ie. latitude, longitude or bearing).
override
toString() String
A string representation of this object.
inherited
tryParse(String dms) double?
Parses a string dms representing degrees/minutes/seconds into a numeric degree value (ie. latitude, longitude or bearing).
inherited
write(StringSink buf, double deg, {bool twoDigitDeg = false}) → void
Writes the degree value deg as a String representation (deg/min/sec) to buf.
override
writeBearing(StringSink buf, double deg) → void
Writes a degree value deg as a String representation (deg/min/sec) of the bearing to buf.
override
writeLat(StringSink buf, double deg) → void
Writes a degree value deg as a String representation (deg/min/sec) of the latitude to buf.
override
writeLon(StringSink buf, double deg) → void
Writes a degree value deg as a String representation (deg/min/sec) of the longitude to buf.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited