123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- import 'package:sport/services/Converter.dart';
- /// id : 4
- /// type : "image"
- /// url : "http://4.jpg"
- /// position : 4
- /// cover : ""
- /// game_id : 3
- class Carousel {
- late int id;
- late String type;
- late String url;
- late int position;
- late String? cover;
- late int gameId;
- Map<String, dynamic> toMap() {
- return {
- 'id': this.id,
- 'type': this.type,
- 'url': this.url,
- 'position': this.position,
- 'cover': this.cover,
- 'game_id': this.gameId,
- };
- }
- factory Carousel.fromMap(Map<String, dynamic> map) {
- return Carousel(
- id: map['id'] as int,
- type: map['type'] as String,
- url: map['url'] as String,
- position: map['position'] as int,
- cover: map['cover'] as String,
- gameId: Converter.toInt(map['game_id']),
- );
- }
- Carousel({
- required this.id,
- required this.type,
- required this.url,
- required this.position,
- required this.cover,
- required this.gameId,
- });
- }
|