-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bd5e262
commit 7cd1fe1
Showing
7 changed files
with
212 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
class GraphDataPoint { | ||
final int month, year, count; | ||
|
||
factory GraphDataPoint.fromJson(Map<String, dynamic> json) { | ||
return GraphDataPoint( | ||
month: json["month"] as int, | ||
year: json["year"] as int, | ||
count: json["count"] as int, | ||
); | ||
} | ||
|
||
GraphDataPoint({ | ||
required this.month, | ||
required this.year, | ||
required this.count, | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
extension ShortNrFormatter on int { | ||
String shortForm() { | ||
if (this < 1000) { | ||
return toString(); | ||
} else if (this < 1000000) { | ||
return "${(this / 1000).floor()}k"; | ||
} else { | ||
return "${(this / 1000000).floor()}m"; | ||
} | ||
} | ||
} |