aman-kassa-flutter/lib/core/models/halyk_post_session.dart

20 lines
578 B
Dart

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<String, dynamic> 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']);
}