From 6fa492c569bea813fc92d51d2145285f5473542e Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Fri, 30 Apr 2021 11:28:18 +0200 Subject: [PATCH] Set correct type for metadata variable --- lib/providers/auth.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/providers/auth.dart b/lib/providers/auth.dart index 089b2cd52..02899f187 100644 --- a/lib/providers/auth.dart +++ b/lib/providers/auth.dart @@ -84,7 +84,7 @@ class Auth with ChangeNotifier { required String serverUrl, }) async { final uri = Uri.parse(serverUrl + '/api/v2/register/'); - Map metadata = Map(); + Map? metadata = Map(); // Read the api key from the manifest file try { @@ -103,7 +103,7 @@ class Auth with ChangeNotifier { uri, headers: { HttpHeaders.contentTypeHeader: 'application/json; charset=UTF-8', - HttpHeaders.authorizationHeader: "Token ${metadata['wger.api_key']}" + HttpHeaders.authorizationHeader: "Token ${metadata!['wger.api_key']}" }, body: json.encode(data), );