Skip to content

Commit

Permalink
fix: fix linting errors and invalid imports
Browse files Browse the repository at this point in the history
  • Loading branch information
rIIh committed Dec 22, 2020
1 parent effd326 commit 316999b
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/src/api_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'package:chopper/chopper.dart';
import 'package:http/http.dart' as http;

import 'service.dart';
import 'token_storage';
import 'token_storage.dart';

class MagxApiClient extends ChopperClient {
TokenStorage tokenProvider;
Expand Down
4 changes: 2 additions & 2 deletions lib/src/client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import 'connection/ws_connection.dart';
import 'room/room.dart';
import 'room/room_data.dart';
import 'service.dart';
import 'token_storage';
import 'token_storage.dart';

class Authentication {
final String id;
Expand Down Expand Up @@ -75,7 +75,7 @@ class MagxClient {
http.Client client,
Iterable interceptors = const [],
}) : transport = params.transport ?? ((p) => WSConnection(p)) {
address = params.address ?? "localhost";
address = params.address ?? 'localhost';
port = params.port;
secure = params.secure;

Expand Down
3 changes: 1 addition & 2 deletions lib/src/room/room.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import 'dart:async';

import 'package:magx_client/src/common/disposable.dart';

import '../client.dart';
import '../common/disposable.dart';
import '../connection/connection.dart';
import 'room_data.dart';

Expand Down
1 change: 1 addition & 0 deletions lib/src/service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class CreateRoomPayload {
@ChopperApi()
abstract class _MagxService extends ChopperService {
@Post(path: '/auth')
// ignore: unused_element
Future<Response> _authenticate(@Body() Map<String, dynamic> body);

@Get(path: '/auth/{token}')
Expand Down
2 changes: 1 addition & 1 deletion test/client_test.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:http/http.dart' as http;
import 'package:magx_client/src/client.dart';
import 'package:magx_client/src/token_storage';
import 'package:magx_client/src/token_storage.dart';
import 'package:test/test.dart';

import 'mock/valid_http_client.dart';
Expand Down
2 changes: 2 additions & 0 deletions test/mock/valid_http_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ class ValidHttpClient extends Fake implements http.Client {
startsWith('/magx/auth/'): () => verify(request),
});
}
default:
throw UnimplementedError();
}
}

Expand Down
4 changes: 2 additions & 2 deletions test/websocket_client_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import 'package:magx_client/src/client.dart';
import 'package:magx_client/src/connection/connection.dart';
import 'package:magx_client/src/room/room.dart';
import 'package:magx_client/src/room/room_data.dart';
import 'package:magx_client/src/token_storage';
import 'package:magx_client/src/token_storage.dart';
import 'package:test/test.dart';
import 'package:uuid/uuid.dart';

Expand Down Expand Up @@ -61,7 +61,7 @@ void main() async {
final data2 = await client2.authenticateGuest(deviceId: Uuid().v4());
token1 = data1.body.token;
token2 = data2.body.token;
} on Exception {}
} catch (_) {}
});

tearDown(() {
Expand Down

0 comments on commit 316999b

Please sign in to comment.