Skip to content

Commit

Permalink
fix null safety
Browse files Browse the repository at this point in the history
  • Loading branch information
TheHCJ committed Apr 24, 2024
1 parent 0680fa9 commit b5fa3ef
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
3 changes: 1 addition & 2 deletions lib/client/login_webview.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ class _TwitterLoginWebviewState extends State<TwitterLoginWebview> {
print(authHeader);

final database = await Repository.writable();
database.insert(tableAccounts,
Account(id: csrfToken, name: "", description: "", authHeader: json.encode(authHeader)).toMap());
database.insert(tableAccounts, Account(id: csrfToken, authHeader: json.encode(authHeader)).toMap());
database.close();
}
Navigator.pop(context);
Expand Down
8 changes: 2 additions & 6 deletions lib/database/entities.dart
Original file line number Diff line number Diff line change
Expand Up @@ -213,17 +213,13 @@ class SubscriptionGroupMember with ToMappable {

class Account {
final String id;
final String name;
final String? description;
final dynamic authHeader;

Account({required this.id, required this.name, this.description, required this.authHeader});
Account({required this.id, required this.authHeader});

factory Account.fromMap(Map<String, Object?> map) {
return Account(
id: map['id'] as String,
name: map['name'] as String,
description: map['description'] as String?,
authHeader: map['auth_header'],
);
}
Expand All @@ -237,6 +233,6 @@ class Account {

@override
Map<String, dynamic> toMap() {
return {'id': id, 'password': name, 'email': description, 'auth_header': authHeader};
return {'id': id, 'auth_header': authHeader};
}
}

0 comments on commit b5fa3ef

Please sign in to comment.