1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- 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;
- late String? outerUrl;
- late String? outerDesc;
- Map<String, dynamic> toMap() {
- return {
- 'id': this.id,
- 'type': this.type,
- 'url': this.url,
- 'position': this.position,
- 'cover': this.cover,
- 'game_id': this.gameId,
- 'outer_url': this.outerUrl,
- 'outer_desc': this.outerDesc,
- };
- }
- 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']),
- outerUrl: map['outer_url'] as String?,
- outerDesc: map['outer_desc'] as String?,
- );
- }
- Carousel({
- required this.id,
- required this.type,
- required this.url,
- required this.position,
- required this.cover,
- required this.gameId,
- required this.outerUrl,
- required this.outerDesc,
- });
- }
|