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

Dependency updates #108

Merged
merged 4 commits into from
Oct 29, 2024
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
33 changes: 11 additions & 22 deletions packages/core/lib/event.dart
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,7 @@ class UserTraits extends JSONExtendableImpl {
this.title,
this.username,
this.website,
Map<String, dynamic>? custom})
: super(custom: custom);
super.custom});

factory UserTraits.fromJson(Map<String, dynamic> json) =>
JSONExtendable.fromJson(
Expand Down Expand Up @@ -239,8 +238,7 @@ class GroupTraits extends JSONExtendableImpl {
this.phone,
this.plan,
this.website,
Map<String, dynamic>? custom})
: super(custom: custom);
super.custom});

factory GroupTraits.fromJson(Map<String, dynamic> json) =>
JSONExtendable.fromJson(
Expand Down Expand Up @@ -277,8 +275,7 @@ class Address extends JSONExtendableImpl {
this.postalCode,
this.state,
this.street,
Map<String, dynamic>? custom})
: super(custom: custom);
super.custom});

factory Address.fromJson(Map<String, dynamic> json) =>
JSONExtendable.fromJson(json, _$AddressFromJson, Address._builtInKeys);
Expand Down Expand Up @@ -307,8 +304,7 @@ class Company extends JSONExtendableImpl {
this.industry,
this.name,
this.plan,
Map<String, dynamic>? custom})
: super(custom: custom);
super.custom});

factory Company.fromJson(Map<String, dynamic> json) =>
JSONExtendable.fromJson(json, _$CompanyFromJson, Company._builtInKeys);
Expand Down Expand Up @@ -338,8 +334,7 @@ class Context extends JSONExtendableImpl {

Context(this.app, this.device, this.library, this.locale, this.network,
this.os, this.screen, this.timezone, this.traits,
{this.instanceId, Map<String, dynamic>? custom})
: super(custom: custom);
{this.instanceId, super.custom});
Context.fromNative(NativeContext nativeContext, this.traits)
: app = nativeContext.app == null
? ContextApp("", "", "", "")
Expand Down Expand Up @@ -391,8 +386,7 @@ class ContextApp extends JSONExtendableImpl {
String version;

ContextApp(this.build, this.name, this.namespace, this.version,
{Map<String, dynamic>? custom})
: super(custom: custom);
{super.custom});
ContextApp.fromNative(NativeContextApp nativeContextApp)
: build = nativeContextApp.build ?? "",
name = nativeContextApp.name ?? "",
Expand Down Expand Up @@ -431,8 +425,7 @@ class ContextDevice extends JSONExtendableImpl {
this.advertisingId,
this.token,
this.trackingStatus,
Map<String, dynamic>? custom})
: super(custom: custom);
super.custom});
ContextDevice.fromNative(NativeContextDevice nativeContextDevice)
: id = nativeContextDevice.id,
manufacturer = nativeContextDevice.manufacturer ?? "",
Expand Down Expand Up @@ -467,8 +460,7 @@ class ContextLibrary extends JSONExtendableImpl {
String name;
String version;

ContextLibrary(this.name, this.version, {Map<String, dynamic>? custom})
: super(custom: custom);
ContextLibrary(this.name, this.version, {super.custom});
ContextLibrary.fromNative(NativeContextLibrary nativeContextLibrary)
: name = nativeContextLibrary.name ?? "",
version = nativeContextLibrary.version ?? "";
Expand All @@ -486,8 +478,7 @@ class ContextOS extends JSONExtendableImpl {
String name;
String version;

ContextOS(this.name, this.version, {Map<String, dynamic>? custom})
: super(custom: custom);
ContextOS(this.name, this.version, {super.custom});
ContextOS.fromNative(NativeContextOS nativeContextOS)
: name = nativeContextOS.name ?? "",
version = nativeContextOS.version ?? "";
Expand All @@ -505,8 +496,7 @@ class ContextNetwork extends JSONExtendableImpl {
bool cellular;
bool wifi;

ContextNetwork(this.cellular, this.wifi, {Map<String, dynamic>? custom})
: super(custom: custom);
ContextNetwork(this.cellular, this.wifi, {super.custom});
ContextNetwork.fromNative(NativeContextNetwork nativeContextNetwork)
: cellular = nativeContextNetwork.cellular ?? false,
wifi = nativeContextNetwork.wifi ?? false;
Expand All @@ -526,8 +516,7 @@ class ContextScreen extends JSONExtendableImpl {
double? density; // android only

ContextScreen(this.height, this.width,
{this.density, Map<String, dynamic>? custom})
: super(custom: custom);
{this.density, super.custom});
ContextScreen.fromNative(NativeContextScreen nativeContextScreen)
: height = nativeContextScreen.height ?? 0,
width = nativeContextScreen.width ?? 0,
Expand Down
8 changes: 4 additions & 4 deletions packages/core/lib/event.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions packages/core/lib/state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ class QueueState<T extends JSONSerialisable> extends PersistedState<List<T>> {
}

class SystemState extends StateNotifier<System> {
SystemState(System system) : super(system);
SystemState(super.system);

set isRunning(bool isRunning) {
state = System(state.isEnabled, isRunning);
Expand Down Expand Up @@ -494,7 +494,7 @@ class TransformerConfigMap {
}

class IntegrationsState extends StateNotifier<Map<String, dynamic>> {
IntegrationsState(Map<String, dynamic> integrations) : super(integrations);
IntegrationsState(super.integrations);

@override
Map<String, dynamic> get state => super.state;
Expand All @@ -510,7 +510,7 @@ class IntegrationsState extends StateNotifier<Map<String, dynamic>> {
}

class ConfigurationState extends StateNotifier<Configuration> {
ConfigurationState(Configuration configuration) : super(configuration);
ConfigurationState(super.configuration);

@override
Configuration get state => super.state;
Expand Down
2 changes: 1 addition & 1 deletion packages/core/lib/state.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 13 additions & 13 deletions packages/core/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,33 @@ repository: https://github.com/segmentio/analytics_flutter/tree/main/packages/co
issue_tracker: https://github.com/segmentio/analytics_flutter/issues

environment:
sdk: '>=2.19.2 <4.0.0'
flutter: ">=2.5.0"
sdk: '>=3.2.0 <4.0.0'
flutter: ">=3.16.0"

dependencies:
flutter:
sdk: flutter
flutter_web_plugins:
sdk: flutter
plugin_platform_interface: ^2.0.2
uuid: ^4.0.0
json_annotation: ^4.8.0
state_notifier: ^0.7.2
plugin_platform_interface: ^2.1.8
uuid: ^4.5.1
json_annotation: ^4.9.0
state_notifier: ^1.0.0
http: ">=0.13.6 <2.0.0"
logger: ^2.0.2+1
path_provider: ^2.0.12
logger: ^2.4.0
path_provider: ^2.1.4
flutter_fgbg: ^0.6.0
shared_preferences: ^2.2.2
web: ^0.5.1
web: ">=0.3.0 <=1.0.0"

dev_dependencies:
build_runner: ^2.3.3
build_runner: ^2.4.7
flutter_test:
sdk: flutter
flutter_lints: ^2.0.0
json_serializable: ^6.6.0
flutter_lints: ^4.0.0
json_serializable: ^6.8.0
pigeon: ^7.2.1
mockito: ^5.3.2
mockito: ^5.4.4

flutter:
plugin:
Expand Down
52 changes: 33 additions & 19 deletions packages/core/test/mocks/mocks.mocks.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Mocks generated by Mockito 5.4.2 from annotations
// Mocks generated by Mockito 5.4.4 from annotations
// in segment_analytics/test/mocks/mocks.dart.
// Do not manually edit this file.

Expand All @@ -8,9 +8,9 @@ import 'dart:convert' as _i2;
import 'dart:typed_data' as _i6;

import 'package:http/http.dart' as _i3;
import 'package:http/src/byte_stream.dart' as _i7;
import 'package:http/src/byte_stream.dart' as _i8;
import 'package:mockito/mockito.dart' as _i1;
import 'package:mockito/src/dummies.dart' as _i8;
import 'package:mockito/src/dummies.dart' as _i7;
import 'package:segment_analytics/event.dart' as _i10;
import 'package:segment_analytics/logger.dart' as _i5;
import 'package:segment_analytics/state.dart' as _i11;
Expand All @@ -21,6 +21,8 @@ import 'package:segment_analytics/utils/store/store.dart' as _i12;
// ignore_for_file: avoid_redundant_argument_values
// ignore_for_file: avoid_setters_without_getters
// ignore_for_file: comment_references
// ignore_for_file: deprecated_member_use
// ignore_for_file: deprecated_member_use_from_same_package
// ignore_for_file: implementation_imports
// ignore_for_file: invalid_use_of_visible_for_testing_member
// ignore_for_file: prefer_const_constructors
Expand Down Expand Up @@ -144,8 +146,14 @@ class MockRequest extends _i1.Mock implements _i3.Request {
@override
String get body => (super.noSuchMethod(
Invocation.getter(#body),
returnValue: '',
returnValueForMissingStub: '',
returnValue: _i7.dummyValue<String>(
this,
Invocation.getter(#body),
),
returnValueForMissingStub: _i7.dummyValue<String>(
this,
Invocation.getter(#body),
),
) as String);

@override
Expand Down Expand Up @@ -176,8 +184,14 @@ class MockRequest extends _i1.Mock implements _i3.Request {
@override
String get method => (super.noSuchMethod(
Invocation.getter(#method),
returnValue: '',
returnValueForMissingStub: '',
returnValue: _i7.dummyValue<String>(
this,
Invocation.getter(#method),
),
returnValueForMissingStub: _i7.dummyValue<String>(
this,
Invocation.getter(#method),
),
) as String);

@override
Expand Down Expand Up @@ -256,26 +270,26 @@ class MockRequest extends _i1.Mock implements _i3.Request {
) as bool);

@override
_i7.ByteStream finalize() => (super.noSuchMethod(
_i8.ByteStream finalize() => (super.noSuchMethod(
Invocation.method(
#finalize,
[],
),
returnValue: _i8.dummyValue<_i7.ByteStream>(
returnValue: _i7.dummyValue<_i8.ByteStream>(
this,
Invocation.method(
#finalize,
[],
),
),
returnValueForMissingStub: _i8.dummyValue<_i7.ByteStream>(
returnValueForMissingStub: _i7.dummyValue<_i8.ByteStream>(
this,
Invocation.method(
#finalize,
[],
),
),
) as _i7.ByteStream);
) as _i8.ByteStream);

@override
_i4.Future<_i3.StreamedResponse> send() => (super.noSuchMethod(
Expand Down Expand Up @@ -375,8 +389,8 @@ class MockStreamSubscription<T> extends _i1.Mock
#asFuture,
[futureValue],
),
returnValue: _i8.ifNotNull(
_i8.dummyValueOrNull<E>(
returnValue: _i7.ifNotNull(
_i7.dummyValueOrNull<E>(
this,
Invocation.method(
#asFuture,
Expand All @@ -392,8 +406,8 @@ class MockStreamSubscription<T> extends _i1.Mock
[futureValue],
),
),
returnValueForMissingStub: _i8.ifNotNull(
_i8.dummyValueOrNull<E>(
returnValueForMissingStub: _i7.ifNotNull(
_i7.dummyValueOrNull<E>(
this,
Invocation.method(
#asFuture,
Expand All @@ -418,10 +432,10 @@ class MockStreamSubscription<T> extends _i1.Mock
class MockHTTPClient extends _i1.Mock implements _i9.HTTPClient {
@override
_i4.Future<bool> startBatchUpload(
String writeKey,
List<_i10.RawEvent> batch,
{String? host}
) =>
String? writeKey,
List<_i10.RawEvent>? batch, {
String? host,
}) =>
(super.noSuchMethod(
Invocation.method(
#startBatchUpload,
Expand Down
Loading