mirror of
https://github.com/rainloreley/shlink-manager.git
synced 2024-11-23 10:13:03 +01:00
added explicit type annotation to variables
This commit is contained in:
parent
0594452584
commit
1ee99f367d
|
@ -9,11 +9,11 @@ import '../server_manager.dart';
|
||||||
/// Gets statistics about the Shlink server
|
/// Gets statistics about the Shlink server
|
||||||
FutureOr<Either<ShlinkStats, Failure>> apiGetShlinkStats(
|
FutureOr<Either<ShlinkStats, Failure>> apiGetShlinkStats(
|
||||||
String? apiKey, String? serverUrl, String apiVersion) async {
|
String? apiKey, String? serverUrl, String apiVersion) async {
|
||||||
var nonOrphanVisits;
|
VisitsSummary? nonOrphanVisits;
|
||||||
var orphanVisits;
|
VisitsSummary? orphanVisits;
|
||||||
var shortUrlsCount;
|
int shortUrlsCount = 0;
|
||||||
var tagsCount;
|
int tagsCount = 0;
|
||||||
var failure;
|
Failure? failure;
|
||||||
|
|
||||||
var visitStatsResponse = await _getVisitStats(apiKey, serverUrl, apiVersion);
|
var visitStatsResponse = await _getVisitStats(apiKey, serverUrl, apiVersion);
|
||||||
visitStatsResponse.fold((l) {
|
visitStatsResponse.fold((l) {
|
||||||
|
@ -46,10 +46,10 @@ FutureOr<Either<ShlinkStats, Failure>> apiGetShlinkStats(
|
||||||
}
|
}
|
||||||
|
|
||||||
if (failure != null) {
|
if (failure != null) {
|
||||||
return right(failure);
|
return right(failure!);
|
||||||
}
|
}
|
||||||
return left(
|
return left(
|
||||||
ShlinkStats(nonOrphanVisits, orphanVisits, shortUrlsCount, tagsCount));
|
ShlinkStats(nonOrphanVisits!, orphanVisits!, shortUrlsCount, tagsCount));
|
||||||
}
|
}
|
||||||
|
|
||||||
class _ShlinkVisitStats {
|
class _ShlinkVisitStats {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user