-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
work_items: add support for adding/removing tags
Closes #41
- Loading branch information
Showing
7 changed files
with
292 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import 'dart:convert'; | ||
|
||
import 'package:http/http.dart'; | ||
|
||
class WorkItemTagsResponse { | ||
WorkItemTagsResponse({ | ||
required this.tags, | ||
}); | ||
|
||
factory WorkItemTagsResponse.fromResponse(Response res) => | ||
WorkItemTagsResponse.fromJson(json.decode(res.body) as Map<String, dynamic>); | ||
|
||
factory WorkItemTagsResponse.fromJson(Map<String, dynamic> json) => WorkItemTagsResponse( | ||
tags: List<WorkItemTag>.from( | ||
(json['value'] as List<dynamic>).map((x) => WorkItemTag.fromJson(x as Map<String, dynamic>)), | ||
), | ||
); | ||
|
||
final List<WorkItemTag> tags; | ||
} | ||
|
||
class WorkItemTag { | ||
WorkItemTag({required this.name}); | ||
|
||
factory WorkItemTag.fromResponse(Response res) => WorkItemTag.fromJson(json.decode(res.body) as Map<String, dynamic>); | ||
|
||
factory WorkItemTag.fromJson(Map<String, dynamic> json) => WorkItemTag(name: json['name'] as String); | ||
|
||
final String name; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.