从无法访问的项目中派生。
project.dart 592 B
import 'package:jihu_gitlab_app/core/id.dart';
class Project {
int id;
String name;
String path;
String pathWithNamespace;
Project._(this.id, this.name, this.path, this.pathWithNamespace);
factory Project.fromJson(Map<String, dynamic> json) {
return Project._(json['id'] ?? 0, json['name'] ?? '', json['path'] ?? '', json['path_with_namespace'] ?? '');
}
factory Project.fromGraphQLJson(Map<String, dynamic> json) {
return Project._(json['id'] != null ? Id.fromGid(json['id'] ?? '/0').id : 0, json['name'] ?? '', json['path'] ?? '', json['fullPath'] ?? '');
}
}