From 578b3a5c907d7a7d187f18a5b995e65c1a469d54 Mon Sep 17 00:00:00 2001 From: Vladyslav_Prykhodko Date: Tue, 20 Feb 2024 17:16:28 +0200 Subject: [PATCH] Format code --- lib/src/service/user_service.dart | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/lib/src/service/user_service.dart b/lib/src/service/user_service.dart index c731b2d..6f35c2a 100644 --- a/lib/src/service/user_service.dart +++ b/lib/src/service/user_service.dart @@ -2,9 +2,9 @@ import 'dart:convert'; import 'package:dio/dio.dart'; -import '../thingsboard_client_base.dart'; import '../http/http_utils.dart'; import '../model/model.dart'; +import '../thingsboard_client_base.dart'; PageData parseUserPageData(Map json) { return PageData.fromJson(json, (json) => User.fromJson(json)); @@ -191,11 +191,12 @@ class UserService { Future getMobileSession(String mobileToken, {RequestConfig? requestConfig}) async { - var options = defaultHttpOptionsFromConfig(requestConfig); + final options = defaultHttpOptionsFromConfig(requestConfig); options.headers?[MOBILE_TOKEN_HEADER] = mobileToken; - var response = await _tbClient.get>( - '/api/user/mobile/session', - options: options); + final response = await _tbClient.get( + '/api/user/mobile/session', + options: options, + ); return response.data != null ? MobileSessionInfo.fromJson(response.data!) : null; @@ -204,16 +205,22 @@ class UserService { Future saveMobileSession( String mobileToken, MobileSessionInfo sessionInfo, {RequestConfig? requestConfig}) async { - var options = defaultHttpOptionsFromConfig(requestConfig); + final options = defaultHttpOptionsFromConfig(requestConfig); options.headers?[MOBILE_TOKEN_HEADER] = mobileToken; - await _tbClient.post('/api/user/mobile/session', - data: jsonEncode(sessionInfo), options: options); + await _tbClient.post( + '/api/user/mobile/session', + data: jsonEncode(sessionInfo), + options: options, + ); } Future removeMobileSession(String mobileToken, {RequestConfig? requestConfig}) async { - var options = defaultHttpOptionsFromConfig(requestConfig); + final options = defaultHttpOptionsFromConfig(requestConfig); options.headers?[MOBILE_TOKEN_HEADER] = mobileToken; - await _tbClient.delete('/api/user/mobile/session', options: options); + await _tbClient.delete( + '/api/user/mobile/session', + options: options, + ); } }