banner_list.dart 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. import 'package:freezed_annotation/freezed_annotation.dart';
  2. import 'package:flutter/foundation.dart';
  3. part 'banner_list.freezed.dart';
  4. part 'banner_list.g.dart';
  5. @freezed
  6. abstract class BannerList with _$BannerList {
  7. const factory BannerList({
  8. Location? location,
  9. Banner? bannerInfo,
  10. List<Banner>? list,
  11. }) = _BannerList;
  12. factory BannerList.fromJson(Map<String, Object?> json) =>
  13. _$BannerListFromJson(json);
  14. }
  15. @freezed
  16. abstract class Location with _$Location {
  17. const factory Location({
  18. int? id,
  19. String? name,
  20. String? code,
  21. String? icon,
  22. String? country,
  23. int? sort,
  24. Coordinates? coordinates,
  25. int? userLevel,
  26. bool? isTrial,
  27. bool? showGDPR,
  28. }) = _Location;
  29. factory Location.fromJson(Map<String, Object?> json) =>
  30. _$LocationFromJson(json);
  31. }
  32. @freezed
  33. abstract class Coordinates with _$Coordinates {
  34. const factory Coordinates({int? lat, int? lng}) = _Coordinates;
  35. factory Coordinates.fromJson(Map<String, Object?> json) =>
  36. _$CoordinatesFromJson(json);
  37. }
  38. @freezed
  39. abstract class Banner with _$Banner {
  40. const factory Banner({
  41. String? action,
  42. String? img,
  43. String? title,
  44. String? content,
  45. String? data,
  46. }) = _Banner;
  47. factory Banner.fromJson(Map<String, Object?> json) => _$BannerFromJson(json);
  48. }