Skip to content

Commit

Permalink
fix: Dart analysis issues
Browse files Browse the repository at this point in the history
  • Loading branch information
rishabh-twilio committed Oct 18, 2024
1 parent 2058974 commit 38639f4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 25 deletions.
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
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

0 comments on commit 38639f4

Please sign in to comment.