From 20e6b49ced376a18ded74d6671b49cc3e745e428 Mon Sep 17 00:00:00 2001 From: problematicconsumer Date: Wed, 26 Jul 2023 19:59:17 +0330 Subject: [PATCH] Fix profile traffic ratio --- lib/domain/profiles/profile.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/domain/profiles/profile.dart b/lib/domain/profiles/profile.dart index 489e45cc..8b5a4af1 100644 --- a/lib/domain/profiles/profile.dart +++ b/lib/domain/profiles/profile.dart @@ -121,7 +121,7 @@ class SubscriptionInfo with _$SubscriptionInfo { int get consumption => upload + download; - double get ratio => consumption / total; + double get ratio => (consumption / total).clamp(0, 1); Duration get remaining => expire.difference(DateTime.now());