Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions lib/platform_android/auth_service_impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ import 'package:registration_client/platform_spi/auth_service.dart';

class AuthServiceImpl implements AuthService {
@override
Future<User> validateUser(String username, String langCode) async {
late User user;
Future<User?> validateUser(String username, String langCode) async {
// late User user;
User? user;
try {
user = await UserApi().validateUser(username, langCode);
} on PlatformException {
Expand All @@ -28,9 +29,10 @@ class AuthServiceImpl implements AuthService {
}

@override
Future<AuthResponse> login(
Future<AuthResponse?> login(
String username, String password, bool isConnected) async {
late AuthResponse authResponse;
// late AuthResponse authResponse;
AuthResponse? authResponse;
try {
authResponse =
await AuthResponseApi().login(username, password, isConnected);
Expand All @@ -43,9 +45,10 @@ class AuthServiceImpl implements AuthService {
}

@override
Future<PacketAuth> packetAuthentication(
Future<PacketAuth?> packetAuthentication(
String username, String password) async {
late PacketAuth packetAuth;
// late PacketAuth packetAuth;
PacketAuth? packetAuth;
try {
packetAuth =
await PacketAuthApi().authenticate(username, password);
Expand Down
5 changes: 3 additions & 2 deletions lib/platform_android/machine_key_service_impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ import 'package:registration_client/platform_spi/machine_key_service.dart';

class MachineKeyImpl implements MachineKeyService {
@override
Future<Machine> getMachineKeys() async {
late Machine machine;
Future<Machine?> getMachineKeys() async {
// late Machine machine;
Machine? machine;
try {
machine = await MachineApi().getMachineDetails();
} on PlatformException {
Expand Down
6 changes: 3 additions & 3 deletions lib/platform_spi/auth_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ import 'package:registration_client/pigeon/user_pigeon.dart';
import 'package:registration_client/platform_android/auth_service_impl.dart';

abstract class AuthService {
Future<User> validateUser(String username, String langCode);
Future<User?> validateUser(String username, String langCode);

Future<AuthResponse> login(
Future<AuthResponse?> login(
String username, String password, bool isConnected);

Future<PacketAuth> packetAuthentication(String username, String password);
Future<PacketAuth?> packetAuthentication(String username, String password);

Future<String> logout();

Expand Down
2 changes: 1 addition & 1 deletion lib/platform_spi/machine_key_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import 'package:registration_client/pigeon/machine_pigeon.dart';
import 'package:registration_client/platform_android/machine_key_service_impl.dart';

abstract class MachineKeyService {
Future<Machine> getMachineKeys();
Future<Machine?> getMachineKeys();

Future<String> getCenterName(String regCenterId, String langCode);

Expand Down