Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dart analyze issues. #144

Merged
merged 1 commit into from
Jan 23, 2025
Merged
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
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
# 0.5.2

* Fixed dart analyze issues.
* Updated dependencies.

# 0.5.1

* Added `reference` property in `Field` class.

# 0.5.0

* Added support for nested object fields.
* Updated dependencies.cd
* Updated dependencies.

# 0.4.0

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Add `typesense` as a [dependency in your pubspec.yaml file](https://flutter.dev/

```@yaml
dependencies:
typesense: ^0.5.1
typesense: ^0.5.2
```

## Usage
Expand Down
2 changes: 1 addition & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
include: package:lints/core.yaml
include: package:lints/recommended.yaml
78 changes: 31 additions & 47 deletions example/console-simple/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,136 +5,120 @@ packages:
dependency: transitive
description:
name: async
sha256: db4766341bd8ecb66556f31ab891a5d596ef829221993531bd64a8e6342f0cda
sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63
url: "https://pub.dev"
source: hosted
version: "2.8.2"
charcode:
dependency: transitive
description:
name: charcode
sha256: fb98c0f6d12c920a02ee2d998da788bca066ca5f148492b7085ee23372b12306
url: "https://pub.dev"
source: hosted
version: "1.3.1"
version: "2.12.0"
collection:
dependency: transitive
description:
name: collection
sha256: "6d4193120997ecfd09acf0e313f13dc122b119e5eca87ef57a7d065ec9183762"
sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76"
url: "https://pub.dev"
source: hosted
version: "1.15.0"
version: "1.19.1"
crypto:
dependency: transitive
description:
name: crypto
sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab
url: "https://pub.dev"
source: hosted
version: "3.0.3"
flutter_lints:
dependency: "direct dev"
description:
name: flutter_lints
sha256: b543301ad291598523947dc534aaddc5aaad597b709d2426d3a0e0d44c5cb493
sha256: "1e445881f28f22d6140f181e07737b22f1e099a5e1ff94b0af2f9e4a463f4855"
url: "https://pub.dev"
source: hosted
version: "1.0.4"
version: "3.0.6"
http:
dependency: transitive
description:
name: http
sha256: "761a297c042deedc1ffbb156d6e2af13886bb305c2a343a4d972504cd67dd938"
sha256: fe7ab022b76f3034adc518fb6ea04a82387620e19977665ea18d30a1cf43442f
url: "https://pub.dev"
source: hosted
version: "1.2.1"
version: "1.3.0"
http_parser:
dependency: transitive
description:
name: http_parser
sha256: e362d639ba3bc07d5a71faebb98cde68c05bfbcfbbb444b60b6f60bb67719185
sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571"
url: "https://pub.dev"
source: hosted
version: "4.0.0"
version: "4.1.2"
lints:
dependency: transitive
dependency: "direct dev"
description:
name: lints
sha256: a2c3d198cb5ea2e179926622d433331d8b58374ab8f29cdda6e863bd62fd369c
sha256: c35bb79562d980e9a453fc715854e1ed39e24e7d0297a880ef54e17f9874a9d7
url: "https://pub.dev"
source: hosted
version: "1.0.1"
version: "5.1.1"
logging:
dependency: "direct main"
description:
name: logging
sha256: "0520a4826042a8a5d09ddd4755623a50d37ee536d79a70452aff8c8ad7bb6c27"
sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61
url: "https://pub.dev"
source: hosted
version: "1.0.1"
version: "1.3.0"
meta:
dependency: transitive
description:
name: meta
sha256: "5202fdd37b4da5fd14a237ed0a01cad6c1efd4c99b5b5a0d3c9237f3728c9485"
sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c
url: "https://pub.dev"
source: hosted
version: "1.7.0"
version: "1.16.0"
path:
dependency: transitive
description:
name: path
sha256: "2ad4cddff7f5cc0e2d13069f2a3f7a73ca18f66abd6f5ecf215219cdb3638edb"
sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5"
url: "https://pub.dev"
source: hosted
version: "1.8.0"
version: "1.9.1"
source_span:
dependency: transitive
description:
name: source_span
sha256: d5f89a9e52b36240a80282b3dc0667dd36e53459717bb17b8fb102d30496606a
sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c"
url: "https://pub.dev"
source: hosted
version: "1.8.1"
version: "1.10.1"
string_scanner:
dependency: transitive
description:
name: string_scanner
sha256: dd11571b8a03f7cadcf91ec26a77e02bfbd6bbba2a512924d3116646b4198fc4
sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43"
url: "https://pub.dev"
source: hosted
version: "1.1.0"
version: "1.4.1"
term_glyph:
dependency: transitive
description:
name: term_glyph
sha256: a88162591b02c1f3a3db3af8ce1ea2b374bd75a7bb8d5e353bcfbdc79d719830
sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e"
url: "https://pub.dev"
source: hosted
version: "1.2.0"
version: "1.2.2"
typed_data:
dependency: transitive
description:
name: typed_data
sha256: "53bdf7e979cfbf3e28987552fd72f637e63f3c8724c9e56d9246942dc2fa36ee"
sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006
url: "https://pub.dev"
source: hosted
version: "1.3.0"
version: "1.4.0"
typesense:
dependency: "direct main"
description:
path: "../.."
relative: true
source: path
version: "0.5.1"
version: "0.5.2"
web:
dependency: transitive
description:
name: web
sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27"
sha256: cd3543bd5798f6ad290ea73d210f423502e71900302dde696f8bff84bf89a1cb
url: "https://pub.dev"
source: hosted
version: "0.5.1"
version: "1.1.0"
sdks:
dart: ">=3.3.2 <4.0.0"
dart: ">=3.6.1 <4.0.0"
6 changes: 3 additions & 3 deletions example/console-simple/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ version: 0.2.0
publish_to: none

environment:
sdk: '>=2.17.0 <3.0.0'
sdk: ^3.6.1

dependencies:
typesense:
path: ../../
logging: ^1.0.1
logging: ^1.3.0

dev_dependencies:
flutter_lints: ^1.0.4
lints: ^5.1.1
2 changes: 0 additions & 2 deletions lib/src/exceptions/exceptions.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
library exceptions;

part 'typesense_exception.dart';

part 'import_error.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/src/exceptions/request_exceptions/http_error.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ part of '../exceptions.dart';
/// The request has failed because of some network layer issues like
/// connection timeouts, etc.
class HttpError extends RequestException {
HttpError(String message, int statusCode) : super(message, statusCode);
HttpError(super.message, super.statusCode);

@override
String toString() {
Expand Down
2 changes: 1 addition & 1 deletion lib/src/exceptions/request_exceptions/server_error.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ part of '../exceptions.dart';

/// 5xx server errors
class ServerError extends RequestException {
ServerError(String message, int statusCode) : super(message, statusCode);
ServerError(super.message, super.statusCode);

@override
String toString() {
Expand Down
3 changes: 0 additions & 3 deletions lib/src/models/field.dart
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,6 @@ extension _Type on Type {

case Type.stringify:
return 'string*';

default:
return '';
}
}

Expand Down
2 changes: 0 additions & 2 deletions lib/src/models/models.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
library models;

import 'package:http/http.dart' as http;
import '../exceptions/exceptions.dart';

Expand Down
2 changes: 1 addition & 1 deletion lib/src/models/schema.dart
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class Schema extends BaseSchema {
}

class UpdateSchema extends BaseSchema {
UpdateSchema(Set<UpdateField> fields) : super(fields);
UpdateSchema(Set<UpdateField> super.fields);

factory UpdateSchema.fromMap(Map<String, dynamic> map) {
final Set<UpdateField> fields = (map['fields'] != null)
Expand Down
6 changes: 2 additions & 4 deletions lib/src/services/api_call.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import 'dart:collection';
import 'package:http/http.dart' as http;

import 'base_api_call.dart';
import 'node_pool.dart';
import 'request_cache.dart';
import '../configuration.dart';
import '../models/models.dart';
Expand All @@ -17,9 +16,8 @@ export 'base_api_call.dart' show contentType;
class ApiCall extends BaseApiCall<Map<String, dynamic>> {
final RequestCache _requestCache;

ApiCall(Configuration config, NodePool nodePool, RequestCache requestCache)
: _requestCache = requestCache,
super(config, nodePool);
ApiCall(super.config, super.nodePool, RequestCache requestCache)
: _requestCache = requestCache;

/// Sends an HTTP GET request to the URL constructed using the [Node.uri],
/// [endpoint] and [queryParams].
Expand Down
5 changes: 1 addition & 4 deletions lib/src/services/collections_api_call.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@ import 'dart:async';
import 'dart:convert';

import './base_api_call.dart';
import './node_pool.dart';
import '../configuration.dart';

export './base_api_call.dart' show contentType;

/// Handles requests that expect JSON data of `List<Map<String, dynamic>>` type
/// from the server.
class CollectionsApiCall extends BaseApiCall<List<Map<String, dynamic>>> {
CollectionsApiCall(Configuration config, NodePool nodePool)
: super(config, nodePool);
CollectionsApiCall(super.config, super.nodePool);

/// Sends an HTTP GET request to the URL constructed using the [Node.uri],
/// [endpoint] and [queryParams].
Expand Down
5 changes: 1 addition & 4 deletions lib/src/services/documents_api_call.dart
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
import 'dart:async';

import './base_api_call.dart';
import './node_pool.dart';
import '../configuration.dart';

export './base_api_call.dart' show contentType;

/// Handles requests that expect JSONL data of `String` type from the server.
class DocumentsApiCall extends BaseApiCall<String> {
DocumentsApiCall(Configuration config, NodePool nodePool)
: super(config, nodePool);
DocumentsApiCall(super.config, super.nodePool);

/// Sends an HTTP GET request to the URL constructed using the [Node.uri],
/// [endpoint] and [queryParams].
Expand Down
2 changes: 0 additions & 2 deletions lib/typesense.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
library typesense;

export 'src/client.dart';
export 'src/search_client.dart';
export 'src/configuration.dart';
Expand Down
18 changes: 9 additions & 9 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
name: typesense
description: Dart client library for accessing the HTTP API of Typesense search engine.
version: 0.5.1
version: 0.5.2
repository: https://github.com/typesense/typesense-dart

environment:
sdk: ^3.3.2
sdk: ^3.6.1

dependencies:
http: ^1.2.1
crypto: ^3.0.3
http: ^1.3.0
crypto: ^3.0.6

dev_dependencies:
test: ^1.25.2
mockito: ^5.4.4
lints: ^3.0.0
build_runner: ^2.4.8
analyzer: ^6.4.1
test: ^1.25.14
mockito: ^5.4.5
lints: ^5.1.1
build_runner: ^2.4.14
analyzer: ^7.2.0
11 changes: 3 additions & 8 deletions test/test_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import 'package:typesense/src/models/models.dart';
import 'package:typesense/src/services/api_call.dart';
import 'package:typesense/src/services/documents_api_call.dart';
import 'package:typesense/src/services/collections_api_call.dart';
import 'package:typesense/src/services/request_cache.dart';
import 'package:typesense/src/services/node_pool.dart';

final String host = InternetAddress.loopbackIPv4.address;
const protocol = Protocol.http,
Expand Down Expand Up @@ -118,22 +116,19 @@ class ConfigurationFactory {
customMocks: [MockSpec<GenerateMockApiCall>(as: #MockApiCall)])
class GenerateMockApiCall extends ApiCall {
GenerateMockApiCall(
Configuration config, NodePool nodePool, RequestCache requestCache)
: super(config, nodePool, requestCache);
super.config, super.nodePool, super.requestCache);
}

@GenerateMocks([], customMocks: [
MockSpec<GenerateMockCollectionsApiCall>(as: #MockCollectionsApiCall)
])
class GenerateMockCollectionsApiCall extends CollectionsApiCall {
GenerateMockCollectionsApiCall(Configuration config, NodePool nodePool)
: super(config, nodePool);
GenerateMockCollectionsApiCall(super.config, super.nodePool);
}

@GenerateMocks([], customMocks: [
MockSpec<GenerateMockDocumentsApiCall>(as: #MockDocumentsApiCall)
])
class GenerateMockDocumentsApiCall extends DocumentsApiCall {
GenerateMockDocumentsApiCall(Configuration config, NodePool nodePool)
: super(config, nodePool);
GenerateMockDocumentsApiCall(super.config, super.nodePool);
}
Loading