mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-08 23:18:16 -07:00
feat: Android TV support (#503)
Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
This commit is contained in:
parent
7ab8c015b9
commit
c299492d6d
168 changed files with 12019 additions and 3073 deletions
|
|
@ -1,26 +1,34 @@
|
|||
// ignore_for_file: public_member_api_docs, sort_constructors_first
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
import 'package:fladder/models/account_model.dart';
|
||||
import 'package:fladder/models/credentials_model.dart';
|
||||
|
||||
class LoginScreenModel {
|
||||
final List<AccountModel> accounts;
|
||||
final CredentialsModel tempCredentials;
|
||||
final bool loading;
|
||||
LoginScreenModel({
|
||||
required this.accounts,
|
||||
required this.tempCredentials,
|
||||
required this.loading,
|
||||
});
|
||||
part 'login_screen_model.freezed.dart';
|
||||
|
||||
LoginScreenModel copyWith({
|
||||
List<AccountModel>? accounts,
|
||||
CredentialsModel? tempCredentials,
|
||||
bool? loading,
|
||||
}) {
|
||||
return LoginScreenModel(
|
||||
accounts: accounts ?? this.accounts,
|
||||
tempCredentials: tempCredentials ?? this.tempCredentials,
|
||||
loading: loading ?? this.loading,
|
||||
);
|
||||
}
|
||||
enum LoginScreenType {
|
||||
users,
|
||||
login,
|
||||
code,
|
||||
}
|
||||
|
||||
@Freezed(copyWith: true)
|
||||
abstract class LoginScreenModel with _$LoginScreenModel {
|
||||
factory LoginScreenModel({
|
||||
@Default([]) List<AccountModel> accounts,
|
||||
@Default(LoginScreenType.users) LoginScreenType screen,
|
||||
ServerLoginModel? serverLoginModel,
|
||||
String? errorMessage,
|
||||
@Default(false) bool hasBaseUrl,
|
||||
@Default(false) bool loading,
|
||||
}) = _LoginScreenModel;
|
||||
}
|
||||
|
||||
@Freezed(copyWith: true)
|
||||
abstract class ServerLoginModel with _$ServerLoginModel {
|
||||
factory ServerLoginModel({
|
||||
required CredentialsModel tempCredentials,
|
||||
@Default([]) List<AccountModel> accounts,
|
||||
String? serverMessage,
|
||||
@Default(false) bool hasQuickConnect,
|
||||
}) = _ServerLoginModel;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue