Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix and update summary section #44

Merged
merged 4 commits into from
May 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/code_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
flutter-version-file: 'pubspec.yaml'
- run: flutter --version

- name: Install dependencies
Expand Down
10 changes: 7 additions & 3 deletions lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,13 @@
"@pageViews": {
"description": "Page views card title and label"
},
"uniques": "Uniques",
"@uniques": {
"description": "Uniques"
"visitors": "Visitors",
"@visitors": {
"description": "Unique visitors"
},
"visits": "Visits",
"@visitors": {
"description": "Unique sessions"
},
"bounces": "Bounces",
"@bounces": {
Expand Down
9 changes: 6 additions & 3 deletions lib/models/api/stats.dart
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
import 'package:halfdot/models/api/common.dart';

class StatsResponse implements ApiModel {
StatsResponse(this.pageViews, this.uniques, this.bounces, this.totalTime);
StatsResponse(
this.pageViews, this.visits, this.visitors, this.bounces, this.totalTime);

StatsResponse.fromJson(Map<String, dynamic> json)
: pageViews = json['pageviews']['value'],
uniques = json['uniques']['value'],
visits = json['visits']['value'],
visitors = json['visitors']['value'],
bounces = json['bounces']['value'],
totalTime = json['totaltime']['value'];

final int pageViews;
final int uniques;
final int visits;
final int visitors;
final int bounces;
final int totalTime;
}
2 changes: 1 addition & 1 deletion lib/screens/settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class SettingsPage extends StatefulWidget {
class _SettingsPageState extends State<SettingsPage> {
Storage storage = Storage.instance;

static const String _apiVersion = '2.7.0';
static const String _apiVersion = '2.11.3';
static const String _repoUrl = 'https://github.com/davquar/halfdot';
static const String _license = 'MIT';
static const String _licenseUrl =
Expand Down
14 changes: 12 additions & 2 deletions lib/screens/website_statistics.dart
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,22 @@ class _WebsiteStatisticsPageState extends State<WebsiteStatisticsPage> {
),
Column(children: <Widget>[
Text(
snapshot.data!.uniques.toString(),
snapshot.data!.visits.toString(),
style: Theme.of(context)
.textTheme
.titleLarge,
),
Text(AppLocalizations.of(context)!.uniques),
Text(AppLocalizations.of(context)!.visits),
]),
Column(children: <Widget>[
Text(
snapshot.data!.visitors.toString(),
style: Theme.of(context)
.textTheme
.titleLarge,
),
Text(
AppLocalizations.of(context)!.visitors),
]),
Column(
children: <Widget>[
Expand Down
2 changes: 1 addition & 1 deletion pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -572,4 +572,4 @@ packages:
version: "3.1.2"
sdks:
dart: ">=3.1.0 <=3.1.2"
flutter: ">=3.13.0"
flutter: ">=3.13.3"
3 changes: 2 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version: 2.1.1+7
version: 2.1.2+8

environment:
sdk: '>=3.0.0 <=3.1.2'
flutter: '3.13.3'

# Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions
Expand Down
Loading