getEntry method

String getEntry(
  1. ProtocolScheme scheme
)

Returns content of .desktop file with only Name and Exec.

Implementation

String getEntry(ProtocolScheme scheme) {
  if (scheme.appPath == null) {
    throw ArgumentError.notNull('scheme.appPath');
  }

  if (scheme.appName == null) {
    throw ArgumentError.notNull('scheme.appName');
  }

  return '''
[Desktop Entry]
Name=${scheme.appName}
Exec=${scheme.appPath} %u
Type=Application
MimeType=x-scheme-handler/${scheme.scheme};
'''
      .trim();
}