backup. before shop update
This commit is contained in:
32
lib/models/booking_date_time.dart
Normal file
32
lib/models/booking_date_time.dart
Normal file
@@ -0,0 +1,32 @@
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
import 'booking_time.dart';
|
||||
|
||||
class BookingDateTime {
|
||||
String viewDate;
|
||||
int unixTime;
|
||||
String sendTimeTip;
|
||||
List<BookingTime> bookTimes;
|
||||
|
||||
BookingDateTime(this.viewDate, this.unixTime, this.sendTimeTip, this.bookTimes);
|
||||
|
||||
BookingDateTime.fromJson(Map<String, dynamic> json)
|
||||
: viewDate = json['view_date'],
|
||||
unixTime = int.parse(json['unix_time'].toString()),
|
||||
sendTimeTip = json['send_time_tip'],
|
||||
bookTimes = (json['book_times'] as List).map((e) => BookingTime.fromJson(e)).toList();
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
'view_date': viewDate,
|
||||
'unix_time': unixTime,
|
||||
'send_time_tip': sendTimeTip,
|
||||
'book_times': bookTimes,
|
||||
};
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return json.encode(this);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user