Skip to content
This repository was archived by the owner on Nov 18, 2025. It is now read-only.
This repository was archived by the owner on Nov 18, 2025. It is now read-only.

Please add support to escape a $ dollar sign in a config file #27

@MoacirSchmidt

Description

@MoacirSchmidt

I have a config file like that:

file "config.yaml":

password: $ya123m

when it is read from code below:

import 'dart:io';
import 'package:safe_config/safe_config.dart';

class AppConfig extends Configuration {
 	AppConfig(String fileName) : super.fromFile(File(fileName));
	
	String password;
}

void main() {
  var config = new AppConfig("config.yaml");
  print("${config.password}"); // -> null????
}

I receive the unhandled exception:
"Invalid configuration data for 'AppConfig'. Missing required values: 'password'"

If I remove $ from 'password' field this error goes away

It seems that there is no support to escape '$' sign in config files (although yaml package seems to support that). Could you please add that. I think there is already a standard where double '$' ($$) is used to escape $ sign.

I have already tried $$ and \$

Thank you very much

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions