added explicit type annotation to variables

This commit is contained in:
Adrian Baumgart 2024-03-31 21:17:12 +02:00
parent 0594452584
commit 1ee99f367d
No known key found for this signature in database

View File

@ -9,11 +9,11 @@ import '../server_manager.dart';
/// Gets statistics about the Shlink server
FutureOr<Either<ShlinkStats, Failure>> apiGetShlinkStats(
String? apiKey, String? serverUrl, String apiVersion) async {
var nonOrphanVisits;
var orphanVisits;
var shortUrlsCount;
var tagsCount;
var failure;
VisitsSummary? nonOrphanVisits;
VisitsSummary? orphanVisits;
int shortUrlsCount = 0;
int tagsCount = 0;
Failure? failure;
var visitStatsResponse = await _getVisitStats(apiKey, serverUrl, apiVersion);
visitStatsResponse.fold((l) {
@ -46,10 +46,10 @@ FutureOr<Either<ShlinkStats, Failure>> apiGetShlinkStats(
}
if (failure != null) {
return right(failure);
return right(failure!);
}
return left(
ShlinkStats(nonOrphanVisits, orphanVisits, shortUrlsCount, tagsCount));
ShlinkStats(nonOrphanVisits!, orphanVisits!, shortUrlsCount, tagsCount));
}
class _ShlinkVisitStats {