INNER CODE UNIT · Dart

_tvShowToDb

hacan359/tonkatsu_box · tool/generate_demo_collections.dart:514

Map<String, dynamic> _tvShowToDb(Map<String, dynamic> json) {
  String? posterUrl;
  final String? posterPath = json['poster_path'] as String?;
  if (posterPath != null) {
    posterUrl = 'https://image.tmdb.org/t/p/w342$posterPath';
  }

  String? backdropUrl;
  final String? backdropPath = json['backdrop_path'] as String?;
  if (backdropPath != null) {
    backdropUrl = 'https://image.tmdb.org/t/p/w780$backdropPath';
  }

  int? firstAirYear;
  final String? firstAirDate = json['first_air_date'] as String?;
  if (firstAirDate != null && firstAirDate.length >= 4) {
    firstAirYear = int.tryParse(firstAirDate.substring(0, 4));
  }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…