bundleId property

String? get bundleId

The application bundle id.

This is read from the windows/runner/Runner.rc file.

Implementation

static String? get bundleId {
  try {
    final file = File(join('windows', 'runner', 'Runner.rc'));
    return file
        .readAsLinesSync()
        .firstWhere(
          (line) => line.contains('VALUE "InternalName"'),
          orElse: () => '',
        )
        .split('VALUE "InternalName", "')[1]
        .split('"')[0]
        .trim();
  } catch (e) {
    print('Error reading file: $e');
    return null;
  }
}