Skip to content

Commit

Permalink
Refactor SpinifyState class to use proper capitalization in type names
Browse files Browse the repository at this point in the history
  • Loading branch information
PlugFox committed May 5, 2024
1 parent 2fa209a commit 1fd3637
Showing 1 changed file with 7 additions and 16 deletions.
23 changes: 7 additions & 16 deletions lib/src/model/state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ sealed class SpinifyState extends _$SpinifyStateBase {
),
_ => throw FormatException('Unknown state: $json'),
};

@override
String toString() => 'SpinifyState\$$type{}';
}

/// Disconnected
Expand All @@ -147,7 +150,7 @@ final class SpinifyState$Disconnected extends SpinifyState {
}) : super(timestamp ?? DateTime.now());

@override
String get type => 'disconnected';
String get type => 'Disconnected';

@override
String? get url => null;
Expand Down Expand Up @@ -196,9 +199,6 @@ final class SpinifyState$Disconnected extends SpinifyState {
identical(this, other) ||
(other is SpinifyState$Disconnected &&
other.timestamp.isAtSameMomentAs(timestamp));

@override
String toString() => r'SpinifyState$Disconnected{}';
}

/// Connecting
Expand All @@ -214,7 +214,7 @@ final class SpinifyState$Connecting extends SpinifyState {
: super(timestamp ?? DateTime.now());

@override
String get type => 'connecting';
String get type => 'Connecting';

@override
final String url;
Expand Down Expand Up @@ -248,9 +248,6 @@ final class SpinifyState$Connecting extends SpinifyState {
identical(this, other) ||
(other is SpinifyState$Connecting &&
other.timestamp.isAtSameMomentAs(timestamp));

@override
String toString() => r'SpinifyState$Connecting{}';
}

/// Connected
Expand All @@ -277,7 +274,7 @@ final class SpinifyState$Connected extends SpinifyState {
}) : super(timestamp ?? DateTime.now());

@override
String get type => 'connected';
String get type => 'Connected';

@override
final String url;
Expand Down Expand Up @@ -355,9 +352,6 @@ final class SpinifyState$Connected extends SpinifyState {
identical(this, other) ||
(other is SpinifyState$Connected &&
other.timestamp.isAtSameMomentAs(timestamp));

@override
String toString() => r'SpinifyState$Connected{}';
}

/// Permanently closed
Expand All @@ -373,7 +367,7 @@ final class SpinifyState$Closed extends SpinifyState {
: super(timestamp ?? DateTime.now());

@override
String get type => 'closed';
String get type => 'Closed';

@override
String? get url => null;
Expand Down Expand Up @@ -407,9 +401,6 @@ final class SpinifyState$Closed extends SpinifyState {
identical(this, other) ||
(other is SpinifyState$Closed &&
other.timestamp.isAtSameMomentAs(timestamp));

@override
String toString() => r'SpinifyState$Closed{}';
}

/// Pattern matching for [SpinifyState].
Expand Down

0 comments on commit 1fd3637

Please sign in to comment.