-
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.
- set margin between badges correctly - store recent stats to only update every 5 minutes
Showing
8 changed files
with
63 additions
and
22 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
part of '../converters.dart'; | ||
|
||
extension DateTimeParsing on DateTime { | ||
String getAsLocalDateTimeString() { | ||
DateTime utcDateTime = this; | ||
DateTime localDateTime = utcDateTime.toLocal(); | ||
final dateString = DateFormat(t.campaigns.poster.date_format).format(localDateTime); | ||
final timeString = DateFormat(t.campaigns.poster.time_format).format(localDateTime); | ||
return t.campaigns.poster.datetime_display_template | ||
.replaceAll('{date}', dateString) | ||
.replaceAll('{time}', timeString); | ||
} | ||
} |
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
11 changes: 11 additions & 0 deletions
11
lib/features/campaigns/models/statistics/campaign_statistics.dart
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 @@ | ||
import 'package:gruene_app/features/campaigns/models/statistics/campaign_statistics_set.dart'; | ||
|
||
class CampaignStatistics { | ||
final CampaignStatisticsSet flyerStats, houseStats, posterStats; | ||
|
||
const CampaignStatistics({ | ||
required this.flyerStats, | ||
required this.houseStats, | ||
required this.posterStats, | ||
}); | ||
} |
10 changes: 10 additions & 0 deletions
10
lib/features/campaigns/models/statistics/campaign_statistics_set.dart
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,10 @@ | ||
class CampaignStatisticsSet { | ||
final double own, division, state, germany; | ||
|
||
const CampaignStatisticsSet({ | ||
required this.own, | ||
required this.division, | ||
required this.state, | ||
required this.germany, | ||
}); | ||
} |
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