|
|
|
@ -163,15 +163,16 @@ class HomeserverPickerController extends State<HomeserverPicker> {
|
|
|
|
|
List<IdentityProvider>? get identityProviders {
|
|
|
|
|
final loginTypes = _rawLoginTypes;
|
|
|
|
|
if (loginTypes == null) return null;
|
|
|
|
|
final List? rawProviders = loginTypes.tryGetList('flows')!.singleWhere(
|
|
|
|
|
(flow) => flow['type'] == AuthenticationTypes.sso,
|
|
|
|
|
)['identity_providers'] ??
|
|
|
|
|
[
|
|
|
|
|
{'id': null},
|
|
|
|
|
];
|
|
|
|
|
final list = (rawProviders as List)
|
|
|
|
|
.map((json) => IdentityProvider.fromJson(json))
|
|
|
|
|
.toList();
|
|
|
|
|
final List? rawProviders =
|
|
|
|
|
loginTypes.tryGetList('flows')?.singleWhereOrNull(
|
|
|
|
|
(flow) => flow['type'] == AuthenticationTypes.sso,
|
|
|
|
|
)['identity_providers'] ??
|
|
|
|
|
[
|
|
|
|
|
{'id': null},
|
|
|
|
|
];
|
|
|
|
|
if (rawProviders == null) return null;
|
|
|
|
|
final list =
|
|
|
|
|
rawProviders.map((json) => IdentityProvider.fromJson(json)).toList();
|
|
|
|
|
if (PlatformInfos.isCupertinoStyle) {
|
|
|
|
|
list.sort((a, b) => a.brand == 'apple' ? -1 : 1);
|
|
|
|
|
}
|
|
|
|
|