TraceFlags.fromString constructor

TraceFlags.fromString(
  1. String hex
)

Creates TraceFlags from a hexadecimal string representation.

This parses the provided hex string and creates appropriate TraceFlags. If the string cannot be parsed, returns TraceFlags with no flags set.

hex A hexadecimal string representation of the flags.

Returns a new TraceFlags instance with the parsed flags.

Implementation

factory TraceFlags.fromString(String hex) {
  final flags = int.tryParse(hex, radix: 16) ?? NONE_FLAG;
  return TraceFlagsCreate.create(flags);
}