dot_xim_parser

A small Dart/Flutter package to parse .xim files into structured Map<String, dynamic> objects.

This package provides a simple XimParser.parse function that reads a .xim-like format (key/value pairs, nested blocks with {} and comments using #) and returns a nested Map representing the file contents.

Features

  • Parse .xim key/value pairs
  • Handle nested blocks using {}
  • Support quoted strings, booleans, ints and doubles
  • Ignore # style comments

Quick example

import 'dart:convert';
import 'package:dot_xim_parser/dot_xim_parser.dart';

void main() {
  const xim = '''
root {
  name: "Example"
  enabled: true
  count: 42
  nested {
    value: "hello"
  }
}
''';

  final result = XimParser.parse(xim);
  print(const JsonEncoder.withIndent('  ').convert(result));
}

Output:

{
  "root": {
    "name": "Example",
    "enabled": true,
    "count": 42,
    "nested": { "value": "hello" }
  }
}

Example app

A minimal runnable Flutter example is included in the example/ folder. Open it with your editor or run it to see the parser in action.

Publishing to pub.dev

Before publishing, ensure the following are set in pubspec.yaml:

  • A clear description and homepage or repository URL.
  • A valid version number.
  • An appropriate license file (this repository includes an LICENSE with the MIT license).

You can run a dry-run publish locally to validate metadata:

  • Use flutter pub publish --dry-run or dart pub publish --dry-run depending on your package type.

See the official publishing guide on dart.dev for details.

License

This package is released under the MIT License - see the LICENSE file for details.

Libraries

dot_xim_parser