dart format

This commit is contained in:
2026-05-08 20:12:40 +02:00
parent 9e139b5704
commit 3b8da1d3d6
295 changed files with 6404 additions and 4161 deletions
@@ -20,9 +20,13 @@ class AutocompleteApi {
);
final response = await http.get(endpoint, headers: NextcloudOcs.headers());
if (response.statusCode != HttpStatus.ok) {
throw Exception('Api call failed with ${response.statusCode}: ${response.body}');
throw Exception(
'Api call failed with ${response.statusCode}: ${response.body}',
);
}
final decoded = jsonDecode(response.body) as Map<String, dynamic>;
return AutocompleteResponse.fromJson(decoded['ocs'] as Map<String, dynamic>);
return AutocompleteResponse.fromJson(
decoded['ocs'] as Map<String, dynamic>,
);
}
}
@@ -8,7 +8,8 @@ class AutocompleteResponse {
AutocompleteResponse(this.data);
factory AutocompleteResponse.fromJson(Map<String, dynamic> json) => _$AutocompleteResponseFromJson(json);
factory AutocompleteResponse.fromJson(Map<String, dynamic> json) =>
_$AutocompleteResponseFromJson(json);
Map<String, dynamic> toJson() => _$AutocompleteResponseToJson(this);
}
@@ -22,9 +23,17 @@ class AutocompleteResponseObject {
String? subline;
String? shareWithDisplayNameUniqe;
AutocompleteResponseObject(this.id, this.label, this.icon, this.source, this.status,
this.subline, this.shareWithDisplayNameUniqe);
AutocompleteResponseObject(
this.id,
this.label,
this.icon,
this.source,
this.status,
this.subline,
this.shareWithDisplayNameUniqe,
);
factory AutocompleteResponseObject.fromJson(Map<String, dynamic> json) => _$AutocompleteResponseObjectFromJson(json);
factory AutocompleteResponseObject.fromJson(Map<String, dynamic> json) =>
_$AutocompleteResponseObjectFromJson(json);
Map<String, dynamic> toJson() => _$AutocompleteResponseObjectToJson(this);
}