Skip to content

Commit b5fa3ef

Browse files
committed
fix null safety
1 parent 0680fa9 commit b5fa3ef

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

lib/client/login_webview.dart

+1-2
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ class _TwitterLoginWebviewState extends State<TwitterLoginWebview> {
5252
print(authHeader);
5353

5454
final database = await Repository.writable();
55-
database.insert(tableAccounts,
56-
Account(id: csrfToken, name: "", description: "", authHeader: json.encode(authHeader)).toMap());
55+
database.insert(tableAccounts, Account(id: csrfToken, authHeader: json.encode(authHeader)).toMap());
5756
database.close();
5857
}
5958
Navigator.pop(context);

lib/database/entities.dart

+2-6
Original file line numberDiff line numberDiff line change
@@ -213,17 +213,13 @@ class SubscriptionGroupMember with ToMappable {
213213

214214
class Account {
215215
final String id;
216-
final String name;
217-
final String? description;
218216
final dynamic authHeader;
219217

220-
Account({required this.id, required this.name, this.description, required this.authHeader});
218+
Account({required this.id, required this.authHeader});
221219

222220
factory Account.fromMap(Map<String, Object?> map) {
223221
return Account(
224222
id: map['id'] as String,
225-
name: map['name'] as String,
226-
description: map['description'] as String?,
227223
authHeader: map['auth_header'],
228224
);
229225
}
@@ -237,6 +233,6 @@ class Account {
237233

238234
@override
239235
Map<String, dynamic> toMap() {
240-
return {'id': id, 'password': name, 'email': description, 'auth_header': authHeader};
236+
return {'id': id, 'auth_header': authHeader};
241237
}
242238
}

0 commit comments

Comments
 (0)