-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #183 from LezdCS/develop
StreamElements oauth2 + overlay support
- Loading branch information
Showing
35 changed files
with
1,012 additions
and
324 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,23 @@ | ||
import 'package:irllink/src/core/utils/globals.dart' as globals; | ||
|
||
abstract class DataState<T> { | ||
final T? data; | ||
final String? error; | ||
|
||
const DataState({ | ||
DataState({ | ||
this.data, | ||
this.error, | ||
}); | ||
}) { | ||
if(error != null) { | ||
globals.talker?.error(error); | ||
} | ||
} | ||
} | ||
|
||
class DataSuccess<T> extends DataState<T> { | ||
const DataSuccess(T data) : super(data: data); | ||
DataSuccess(T data) : super(data: data); | ||
} | ||
|
||
class DataFailed<T> extends DataState<T> { | ||
const DataFailed(String error) : super(error: error); | ||
DataFailed(String error) : super(error: error); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
lib/src/data/entities/stream_elements/se_credentials_dto.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import 'package:irllink/src/domain/entities/stream_elements/se_credentials.dart'; | ||
|
||
class SeCredentialsDTO extends SeCredentials { | ||
const SeCredentialsDTO({ | ||
required super.accessToken, | ||
required super.refreshToken, | ||
required super.expiresIn, | ||
required super.scopes, | ||
}); | ||
|
||
@override | ||
Map toJson() => { | ||
'accessToken': accessToken, | ||
'refreshToken': refreshToken, | ||
'expiresIn': expiresIn, | ||
'scopes': scopes, | ||
}; | ||
|
||
factory SeCredentialsDTO.fromJson(Map<String, dynamic> map) { | ||
return SeCredentialsDTO( | ||
accessToken: map['accessToken'] as String, | ||
refreshToken: map['refreshToken'] as String, | ||
expiresIn: map['expiresIn'] as int, | ||
scopes: map['scopes'] as String, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.