working login page

This commit is contained in:
Henry Hiles 2026-01-25 13:02:40 +00:00
commit 47a758a33b
No known key found for this signature in database
12 changed files with 133 additions and 245 deletions

View file

@ -0,0 +1,12 @@
import "package:freezed_annotation/freezed_annotation.dart";
part "homeserver.freezed.dart";
@freezed
abstract class Homeserver with _$Homeserver {
const factory Homeserver({
required String name,
required String description,
required Uri url,
required String iconUrl,
}) = _Homeserver;
}

14
lib/models/login.dart Normal file
View file

@ -0,0 +1,14 @@
import "package:freezed_annotation/freezed_annotation.dart";
part "login.freezed.dart";
part "login.g.dart";
@freezed
abstract class Login with _$Login {
const factory Login({
required String username,
required String password,
required String homeserverUrl,
}) = _Login;
factory Login.fromJson(Map<String, Object?> json) => _$LoginFromJson(json);
}

View file

@ -5,7 +5,7 @@ part "sync_status.g.dart";
@freezed
abstract class SyncStatus with _$SyncStatus {
const factory SyncStatus({
required Type type,
required SyncStatusType type,
required int errorCount,
required int lastSync,
}) = _SyncStatus;
@ -15,4 +15,4 @@ abstract class SyncStatus with _$SyncStatus {
}
@JsonEnum(fieldRename: FieldRename.snake)
enum Type { ok, waiting, erroring, permanentlyFailed }
enum SyncStatusType { ok, waiting, erroring, permanentlyFailed }