Skip to content

Commit 06f110a

Browse files
Dependency updates (#108)
* fix: web is pinned to version 0.3.0 by flutter_test from the flutter SDK on Flutter 3.2.0. chore(dependencies): Updated project dependencies. - Updates minimum supported SDK version to Flutter 3.16/Dart 3.2 - Updates plugin_platform_interface to ^2.1.8 - Updates uuid to ^4.5.1 - Updates json_annotation ^4.9.0 - Updates state_notifier to ^1.0.0 - Updates logger ^2.4.0 - Updates web between ">=0.3.0 <=0.5.1" - Updates few other dev dependencies * chore(dependencies): Updated project dependencies. - Updates web between ">=0.3.0 <=1.0.0" * fix: Dart analysis issues --------- Co-authored-by: Rishabh Jain <[email protected]>
1 parent 96ecf06 commit 06f110a

File tree

6 files changed

+65
-62
lines changed

6 files changed

+65
-62
lines changed

packages/core/lib/event.dart

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,7 @@ class UserTraits extends JSONExtendableImpl {
182182
this.title,
183183
this.username,
184184
this.website,
185-
Map<String, dynamic>? custom})
186-
: super(custom: custom);
185+
super.custom});
187186

188187
factory UserTraits.fromJson(Map<String, dynamic> json) =>
189188
JSONExtendable.fromJson(
@@ -239,8 +238,7 @@ class GroupTraits extends JSONExtendableImpl {
239238
this.phone,
240239
this.plan,
241240
this.website,
242-
Map<String, dynamic>? custom})
243-
: super(custom: custom);
241+
super.custom});
244242

245243
factory GroupTraits.fromJson(Map<String, dynamic> json) =>
246244
JSONExtendable.fromJson(
@@ -277,8 +275,7 @@ class Address extends JSONExtendableImpl {
277275
this.postalCode,
278276
this.state,
279277
this.street,
280-
Map<String, dynamic>? custom})
281-
: super(custom: custom);
278+
super.custom});
282279

283280
factory Address.fromJson(Map<String, dynamic> json) =>
284281
JSONExtendable.fromJson(json, _$AddressFromJson, Address._builtInKeys);
@@ -307,8 +304,7 @@ class Company extends JSONExtendableImpl {
307304
this.industry,
308305
this.name,
309306
this.plan,
310-
Map<String, dynamic>? custom})
311-
: super(custom: custom);
307+
super.custom});
312308

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

339335
Context(this.app, this.device, this.library, this.locale, this.network,
340336
this.os, this.screen, this.timezone, this.traits,
341-
{this.instanceId, Map<String, dynamic>? custom})
342-
: super(custom: custom);
337+
{this.instanceId, super.custom});
343338
Context.fromNative(NativeContext nativeContext, this.traits)
344339
: app = nativeContext.app == null
345340
? ContextApp("", "", "", "")
@@ -391,8 +386,7 @@ class ContextApp extends JSONExtendableImpl {
391386
String version;
392387

393388
ContextApp(this.build, this.name, this.namespace, this.version,
394-
{Map<String, dynamic>? custom})
395-
: super(custom: custom);
389+
{super.custom});
396390
ContextApp.fromNative(NativeContextApp nativeContextApp)
397391
: build = nativeContextApp.build ?? "",
398392
name = nativeContextApp.name ?? "",
@@ -431,8 +425,7 @@ class ContextDevice extends JSONExtendableImpl {
431425
this.advertisingId,
432426
this.token,
433427
this.trackingStatus,
434-
Map<String, dynamic>? custom})
435-
: super(custom: custom);
428+
super.custom});
436429
ContextDevice.fromNative(NativeContextDevice nativeContextDevice)
437430
: id = nativeContextDevice.id,
438431
manufacturer = nativeContextDevice.manufacturer ?? "",
@@ -467,8 +460,7 @@ class ContextLibrary extends JSONExtendableImpl {
467460
String name;
468461
String version;
469462

470-
ContextLibrary(this.name, this.version, {Map<String, dynamic>? custom})
471-
: super(custom: custom);
463+
ContextLibrary(this.name, this.version, {super.custom});
472464
ContextLibrary.fromNative(NativeContextLibrary nativeContextLibrary)
473465
: name = nativeContextLibrary.name ?? "",
474466
version = nativeContextLibrary.version ?? "";
@@ -486,8 +478,7 @@ class ContextOS extends JSONExtendableImpl {
486478
String name;
487479
String version;
488480

489-
ContextOS(this.name, this.version, {Map<String, dynamic>? custom})
490-
: super(custom: custom);
481+
ContextOS(this.name, this.version, {super.custom});
491482
ContextOS.fromNative(NativeContextOS nativeContextOS)
492483
: name = nativeContextOS.name ?? "",
493484
version = nativeContextOS.version ?? "";
@@ -505,8 +496,7 @@ class ContextNetwork extends JSONExtendableImpl {
505496
bool cellular;
506497
bool wifi;
507498

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

528518
ContextScreen(this.height, this.width,
529-
{this.density, Map<String, dynamic>? custom})
530-
: super(custom: custom);
519+
{this.density, super.custom});
531520
ContextScreen.fromNative(NativeContextScreen nativeContextScreen)
532521
: height = nativeContextScreen.height ?? 0,
533522
width = nativeContextScreen.width ?? 0,

packages/core/lib/event.g.dart

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/core/lib/state.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ class QueueState<T extends JSONSerialisable> extends PersistedState<List<T>> {
267267
}
268268

269269
class SystemState extends StateNotifier<System> {
270-
SystemState(System system) : super(system);
270+
SystemState(super.system);
271271

272272
set isRunning(bool isRunning) {
273273
state = System(state.isEnabled, isRunning);
@@ -500,7 +500,7 @@ class TransformerConfigMap {
500500
}
501501

502502
class IntegrationsState extends StateNotifier<Map<String, dynamic>> {
503-
IntegrationsState(Map<String, dynamic> integrations) : super(integrations);
503+
IntegrationsState(super.integrations);
504504

505505
@override
506506
Map<String, dynamic> get state => super.state;
@@ -516,7 +516,7 @@ class IntegrationsState extends StateNotifier<Map<String, dynamic>> {
516516
}
517517

518518
class ConfigurationState extends StateNotifier<Configuration> {
519-
ConfigurationState(Configuration configuration) : super(configuration);
519+
ConfigurationState(super.configuration);
520520

521521
@override
522522
Configuration get state => super.state;

packages/core/lib/state.g.dart

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/core/pubspec.yaml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,33 @@ repository: https://github.com/segmentio/analytics_flutter/tree/main/packages/co
66
issue_tracker: https://github.com/segmentio/analytics_flutter/issues
77

88
environment:
9-
sdk: '>=2.19.2 <4.0.0'
10-
flutter: ">=2.5.0"
9+
sdk: '>=3.2.0 <4.0.0'
10+
flutter: ">=3.16.0"
1111

1212
dependencies:
1313
flutter:
1414
sdk: flutter
1515
flutter_web_plugins:
1616
sdk: flutter
17-
plugin_platform_interface: ^2.0.2
18-
uuid: ^4.0.0
19-
json_annotation: ^4.8.0
20-
state_notifier: ^0.7.2
17+
plugin_platform_interface: ^2.1.8
18+
uuid: ^4.5.1
19+
json_annotation: ^4.9.0
20+
state_notifier: ^1.0.0
2121
http: ">=0.13.6 <2.0.0"
22-
logger: ^2.0.2+1
23-
path_provider: ^2.0.12
22+
logger: ^2.4.0
23+
path_provider: ^2.1.4
2424
flutter_fgbg: ^0.6.0
2525
shared_preferences: ^2.2.2
26-
web: ^0.5.1
26+
web: ">=0.3.0 <=1.0.0"
2727

2828
dev_dependencies:
29-
build_runner: ^2.3.3
29+
build_runner: ^2.4.7
3030
flutter_test:
3131
sdk: flutter
32-
flutter_lints: ^2.0.0
33-
json_serializable: ^6.6.0
32+
flutter_lints: ^4.0.0
33+
json_serializable: ^6.8.0
3434
pigeon: ^7.2.1
35-
mockito: ^5.3.2
35+
mockito: ^5.4.4
3636

3737
flutter:
3838
plugin:

packages/core/test/mocks/mocks.mocks.dart

Lines changed: 33 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Mocks generated by Mockito 5.4.2 from annotations
1+
// Mocks generated by Mockito 5.4.4 from annotations
22
// in segment_analytics/test/mocks/mocks.dart.
33
// Do not manually edit this file.
44

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

1010
import 'package:http/http.dart' as _i3;
11-
import 'package:http/src/byte_stream.dart' as _i7;
11+
import 'package:http/src/byte_stream.dart' as _i8;
1212
import 'package:mockito/mockito.dart' as _i1;
13-
import 'package:mockito/src/dummies.dart' as _i8;
13+
import 'package:mockito/src/dummies.dart' as _i7;
1414
import 'package:segment_analytics/event.dart' as _i10;
1515
import 'package:segment_analytics/logger.dart' as _i5;
1616
import 'package:segment_analytics/state.dart' as _i11;
@@ -21,6 +21,8 @@ import 'package:segment_analytics/utils/store/store.dart' as _i12;
2121
// ignore_for_file: avoid_redundant_argument_values
2222
// ignore_for_file: avoid_setters_without_getters
2323
// ignore_for_file: comment_references
24+
// ignore_for_file: deprecated_member_use
25+
// ignore_for_file: deprecated_member_use_from_same_package
2426
// ignore_for_file: implementation_imports
2527
// ignore_for_file: invalid_use_of_visible_for_testing_member
2628
// ignore_for_file: prefer_const_constructors
@@ -144,8 +146,14 @@ class MockRequest extends _i1.Mock implements _i3.Request {
144146
@override
145147
String get body => (super.noSuchMethod(
146148
Invocation.getter(#body),
147-
returnValue: '',
148-
returnValueForMissingStub: '',
149+
returnValue: _i7.dummyValue<String>(
150+
this,
151+
Invocation.getter(#body),
152+
),
153+
returnValueForMissingStub: _i7.dummyValue<String>(
154+
this,
155+
Invocation.getter(#body),
156+
),
149157
) as String);
150158

151159
@override
@@ -176,8 +184,14 @@ class MockRequest extends _i1.Mock implements _i3.Request {
176184
@override
177185
String get method => (super.noSuchMethod(
178186
Invocation.getter(#method),
179-
returnValue: '',
180-
returnValueForMissingStub: '',
187+
returnValue: _i7.dummyValue<String>(
188+
this,
189+
Invocation.getter(#method),
190+
),
191+
returnValueForMissingStub: _i7.dummyValue<String>(
192+
this,
193+
Invocation.getter(#method),
194+
),
181195
) as String);
182196

183197
@override
@@ -256,26 +270,26 @@ class MockRequest extends _i1.Mock implements _i3.Request {
256270
) as bool);
257271

258272
@override
259-
_i7.ByteStream finalize() => (super.noSuchMethod(
273+
_i8.ByteStream finalize() => (super.noSuchMethod(
260274
Invocation.method(
261275
#finalize,
262276
[],
263277
),
264-
returnValue: _i8.dummyValue<_i7.ByteStream>(
278+
returnValue: _i7.dummyValue<_i8.ByteStream>(
265279
this,
266280
Invocation.method(
267281
#finalize,
268282
[],
269283
),
270284
),
271-
returnValueForMissingStub: _i8.dummyValue<_i7.ByteStream>(
285+
returnValueForMissingStub: _i7.dummyValue<_i8.ByteStream>(
272286
this,
273287
Invocation.method(
274288
#finalize,
275289
[],
276290
),
277291
),
278-
) as _i7.ByteStream);
292+
) as _i8.ByteStream);
279293

280294
@override
281295
_i4.Future<_i3.StreamedResponse> send() => (super.noSuchMethod(
@@ -375,8 +389,8 @@ class MockStreamSubscription<T> extends _i1.Mock
375389
#asFuture,
376390
[futureValue],
377391
),
378-
returnValue: _i8.ifNotNull(
379-
_i8.dummyValueOrNull<E>(
392+
returnValue: _i7.ifNotNull(
393+
_i7.dummyValueOrNull<E>(
380394
this,
381395
Invocation.method(
382396
#asFuture,
@@ -392,8 +406,8 @@ class MockStreamSubscription<T> extends _i1.Mock
392406
[futureValue],
393407
),
394408
),
395-
returnValueForMissingStub: _i8.ifNotNull(
396-
_i8.dummyValueOrNull<E>(
409+
returnValueForMissingStub: _i7.ifNotNull(
410+
_i7.dummyValueOrNull<E>(
397411
this,
398412
Invocation.method(
399413
#asFuture,
@@ -418,10 +432,10 @@ class MockStreamSubscription<T> extends _i1.Mock
418432
class MockHTTPClient extends _i1.Mock implements _i9.HTTPClient {
419433
@override
420434
_i4.Future<bool> startBatchUpload(
421-
String writeKey,
422-
List<_i10.RawEvent> batch,
423-
{String? host}
424-
) =>
435+
String? writeKey,
436+
List<_i10.RawEvent>? batch, {
437+
String? host,
438+
}) =>
425439
(super.noSuchMethod(
426440
Invocation.method(
427441
#startBatchUpload,

0 commit comments

Comments
 (0)