repo.dart

mail@pastecode.io avatar
unknown
dart
2 years ago
711 B
2
Indexable
Never
class Repo {
  // bir repoya karşılık
  String? name;
  String? htmlUrl;
  int? stargazerCount;
  String? description;

  Repo({this.name, this.htmlUrl, this.stargazerCount, this.description});

  factory Repo.fromJson(Map<String, dynamic> json) {
    return Repo(
      name: json['name'],
      htmlUrl: json['htmlUrl'],
      stargazerCount: json['stargazerCount'],
      description: json['description'],
    );
  }
}

class All {
  List<Repo>? repos; // tüm repolar için liste

  All({this.repos});

  factory All.fromJson(List<dynamic> json) {
    List<Repo>? repos = <Repo>[];
    repos = json.map((e) => Repo.fromJson(e)).toList();
    return All(repos: repos);
  }
}