resolve melos analyze warnings

This commit is contained in:
Neevash Ramdial
2021-01-15 12:17:48 -04:00
parent 228233d89e
commit 4589dd8645
18 changed files with 44 additions and 131 deletions
@@ -14,7 +14,11 @@ import 'web_socket_channel_stub.dart'
if (dart.library.html) 'web_socket_channel_html.dart'
if (dart.library.io) 'web_socket_channel_io.dart';
/// Typedef which exposes an [Event] as the only parameter.
typedef EventHandler = void Function(Event);
/// Typedef used for connecting to a websocket. Method returns a [WebSocketChannel]
/// and accepts a connection [url] and an optional [Iterable] of `protocols`.
typedef ConnectWebSocket = WebSocketChannel Function(String url,
{Iterable<String> protocols});
@@ -236,7 +240,9 @@ class WebSocket {
try {
await connect();
} catch (e) {}
} catch (e) {
logger.log(Level.SEVERE, e.toString());
}
await Future.delayed(
Duration(seconds: min(_retryAttempt * 5, 25)),
() {
+11 -3
View File
@@ -13,6 +13,7 @@ import 'package:stream_chat/src/models/channel_model.dart';
import 'package:stream_chat/src/models/own_user.dart';
import 'package:stream_chat/version.dart';
import 'package:uuid/uuid.dart';
import 'package:pedantic/pedantic.dart' show unawaited;
import 'api/channel.dart';
import 'api/connection_status.dart';
@@ -25,8 +26,15 @@ import 'models/event.dart';
import 'models/message.dart';
import 'models/user.dart';
/// Handler function used for logging records. Function requires a single [LogRecord]
/// as the only parameter.
typedef LogHandlerFunction = void Function(LogRecord record);
/// Used for decoding [Map] data to a generic type `T`.
typedef DecoderFunction<T> = T Function(Map<String, dynamic>);
/// A function which can be used to request a Stream Chat API token from your
/// own backend server. Function requires a single [userId].
typedef TokenProvider = Future<String> Function(String userId);
/// The key used to save the userId to sharedPreferences
@@ -462,7 +470,7 @@ class Client {
if (value == ConnectionStatus.connected &&
state.channels?.isNotEmpty == true) {
queryChannels(filter: {
unawaited (queryChannels(filter: {
'cid': {
'\$in': state.channels.keys.toList(),
},
@@ -474,7 +482,7 @@ class Client {
online: true,
));
},
);
));
} else {
_synced = false;
}
@@ -712,7 +720,7 @@ class Client {
}
}
_parseError(DioError error) {
dynamic _parseError(DioError error) {
if (error.type == DioErrorType.RESPONSE) {
final apiError =
ApiError(error.response?.data, error.response?.statusCode);
@@ -1,3 +1,4 @@
//ignore_for_file: public_member_api_docs
import 'dart:io';
import 'dart:isolate';
import 'package:flutter/material.dart';
@@ -9,7 +10,7 @@ import 'package:path_provider/path_provider.dart';
import 'package:stream_chat/src/db/offline_storage.dart';
class SharedDB {
static constructDatabase(dbName) async {
static Future<VmDatabase> constructDatabase(dbName) async {
final dir = await getApplicationDocumentsDirectory();
final path = join(dir.path, dbName);
final file = File(path);
@@ -1,3 +1,5 @@
//ignore_for_file: public_member_api_docs
//ignore_for_file: always_declare_return_types
class SharedDB {
static constructDatabase(dbName) async {
print('Unsupported Platform');
@@ -1,3 +1,5 @@
//ignore_for_file: public_member_api_docs
//ignore_for_file: always_declare_return_types
import 'package:moor/moor_web.dart';
import 'package:stream_chat/src/db/offline_storage.dart';