getSession method Null safety

Future<Map<String, dynamic>> getSession(
  1. {List<String> fields = const ['alt-speed-enabled', 'speed-limit-down-enabled', 'speed-limit-up-enabled', 'download-dir', 'speed-limit-down', 'speed-limit-up', 'alt-speed-down', 'alt-speed-up', 'version']}
)

Get data session, fields can be provided to get only needed information fields to retrieve, can be checked at https://github.com/transmission/transmission/blob/master/extras/rpc-spec.txt Returns Map of the session's data Throws TransmissionException if errors

Implementation

Future<Map<String, dynamic>> getSession({
  List<String> fields = const [
    'alt-speed-enabled',
    'speed-limit-down-enabled',
    'speed-limit-up-enabled',
    'download-dir',
    'speed-limit-down',
    'speed-limit-up',
    'alt-speed-down',
    'alt-speed-up',
    'version',
  ],
}) async {
  final results = await _dio.post('/',
      data: _Request(methodGetSession, arguments: {
        'fields': fields,
      }).toJSON());
  final response = _Response.fromJSON(results.data);
  _checkResults(response);
  return response.arguments!;
}