dot_xim_parser 0.0.2
dot_xim_parser: ^0.0.2 copied to clipboard
A small Dart/Flutter package to parse .xim files into structured Maps.
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
.ximkey/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
descriptionandhomepageorrepositoryURL. - A valid
versionnumber. - An appropriate
licensefile (this repository includes anLICENSEwith the MIT license).
You can run a dry-run publish locally to validate metadata:
- Use
flutter pub publish --dry-runordart pub publish --dry-rundepending 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.