Move to Flutter 3.47, use the improvements that come with this (#64)
Reviewed-on: #64
This commit is contained in:
parent
01b13b4764
commit
077044ec19
157 changed files with 1366 additions and 1457 deletions
|
|
@ -1,16 +1,18 @@
|
|||
import "package:freezed_annotation/freezed_annotation.dart";
|
||||
|
||||
part "exchange_token.freezed.dart";
|
||||
part "exchange_token.g.dart";
|
||||
|
||||
@freezed
|
||||
abstract class OAuthExchangeTokenRequest with _$OAuthExchangeTokenRequest {
|
||||
const factory OAuthExchangeTokenRequest({
|
||||
required Uri homeserverUrl,
|
||||
required String codeVerifier,
|
||||
required Uri redirectUri,
|
||||
required String code,
|
||||
required String clientId,
|
||||
}) = _OAuthExchangeTokenRequest;
|
||||
@Freezed(toJson: false, fromJson: false)
|
||||
@JsonSerializable()
|
||||
class const OAuthExchangeTokenRequest({
|
||||
required final Uri homeserverUrl,
|
||||
required final String codeVerifier,
|
||||
required final Uri redirectUri,
|
||||
required final String code,
|
||||
required final String clientId,
|
||||
}) with _$OAuthExchangeTokenRequest {
|
||||
Map<String, Object?> toJson() => _$OAuthExchangeTokenRequestToJson(this);
|
||||
|
||||
factory OAuthExchangeTokenRequest.fromJson(Map<String, Object?> json) =>
|
||||
_$OAuthExchangeTokenRequestFromJson(json);
|
||||
|
|
|
|||
|
|
@ -2,25 +2,27 @@ import "dart:math";
|
|||
|
||||
import "package:fast_immutable_collections/fast_immutable_collections.dart";
|
||||
import "package:freezed_annotation/freezed_annotation.dart";
|
||||
|
||||
part "get_auth_url.freezed.dart";
|
||||
part "get_auth_url.g.dart";
|
||||
|
||||
@freezed
|
||||
abstract class OAuthGetAuthUrl with _$OAuthGetAuthUrl {
|
||||
const factory OAuthGetAuthUrl({
|
||||
required ResponseMode responseMode,
|
||||
required Uri homeserverUrl,
|
||||
required Uri redirectUri,
|
||||
required IList<String> scopes,
|
||||
required String clientId,
|
||||
String? userIdHint,
|
||||
}) = _OAuthGetAuthUrl;
|
||||
@Freezed(toJson: false, fromJson: false)
|
||||
@JsonSerializable()
|
||||
class const OAuthGetAuthUrl({
|
||||
required final ResponseMode responseMode,
|
||||
required final Uri homeserverUrl,
|
||||
required final Uri redirectUri,
|
||||
required final IList<String> scopes,
|
||||
required final String clientId,
|
||||
final String? userIdHint,
|
||||
}) with _$OAuthGetAuthUrl {
|
||||
Map<String, Object?> toJson() => _$OAuthGetAuthUrlToJson(this);
|
||||
|
||||
factory OAuthGetAuthUrl.fromJson(Map<String, Object?> json) =>
|
||||
_$OAuthGetAuthUrlFromJson(json);
|
||||
}
|
||||
|
||||
abstract class Scope {
|
||||
sealed class Scope {
|
||||
static final openid = "openid";
|
||||
static final email = "email";
|
||||
static final clientApi = "urn:matrix:client:api:*";
|
||||
|
|
|
|||
|
|
@ -1,26 +1,27 @@
|
|||
import "package:fast_immutable_collections/fast_immutable_collections.dart";
|
||||
import "package:freezed_annotation/freezed_annotation.dart";
|
||||
|
||||
part "register_client.freezed.dart";
|
||||
part "register_client.g.dart";
|
||||
|
||||
@freezed
|
||||
abstract class OAuthRegisterClientRequest with _$OAuthRegisterClientRequest {
|
||||
const factory OAuthRegisterClientRequest({
|
||||
required Uri homeserverUrl,
|
||||
@Default(ApplicationType.web) ApplicationType applicationType,
|
||||
String? clientName,
|
||||
required Uri clientUri,
|
||||
Uri? logoUri,
|
||||
Uri? policyUri,
|
||||
Uri? tosUri,
|
||||
IList<GrantType>? grantTypes,
|
||||
IList<Uri>? redirectUris,
|
||||
IList<ResponseType>? responseTypes,
|
||||
@Freezed(toJson: false, fromJson: false)
|
||||
@JsonSerializable()
|
||||
class const OAuthRegisterClientRequest({
|
||||
required final Uri homeserverUrl,
|
||||
final ApplicationType applicationType = ApplicationType.web,
|
||||
final String? clientName,
|
||||
required final Uri clientUri,
|
||||
final Uri? logoUri,
|
||||
final Uri? policyUri,
|
||||
final Uri? tosUri,
|
||||
final IList<GrantType>? grantTypes,
|
||||
final IList<Uri>? redirectUris,
|
||||
final IList<ResponseType>? responseTypes,
|
||||
|
||||
@Default(AuthMethod.none)
|
||||
@JsonKey(name: "token_endpoint_auth_method")
|
||||
AuthMethod? authMethod,
|
||||
}) = _OAuthRegisterClientRequest;
|
||||
@JsonKey(name: "token_endpoint_auth_method")
|
||||
final AuthMethod? authMethod = AuthMethod.none,
|
||||
}) with _$OAuthRegisterClientRequest {
|
||||
Map<String, Object?> toJson() => _$OAuthRegisterClientRequestToJson(this);
|
||||
|
||||
factory OAuthRegisterClientRequest.fromJson(Map<String, Object?> json) =>
|
||||
_$OAuthRegisterClientRequestFromJson(json);
|
||||
|
|
|
|||
Loading…
Reference in a new issue