import 'package:intl/intl.dart'; class HalykPosSession { const HalykPosSession( {this.login, this.token, this.serverTime, this.tokenTimeout}); final String login; final String token; final DateTime serverTime; final int tokenTimeout; static HalykPosSession fromJson(Map data) => HalykPosSession( login: data['login'], token: data['token'], serverTime: data['ServerTime'] != null ? new DateFormat("dd.MM.yyyy HH:mm:ss ZZZ").parse(data['ServerTime']) : null, tokenTimeout: data['TokenTimeout']); }