Commit 9da8c1b0 authored by CLOUARD Regis's avatar CLOUARD Regis
Browse files

Merge branch '103_Limit-Kalman-correction' into 'master'

103 limit kalman correction

See merge request !90
parents 30b787ea 13ee4ca4
......@@ -25,7 +25,7 @@ class HistoryItemView extends StatelessWidget {
padding: MaterialStateProperty.all(const EdgeInsets.all(10)),
),
onPressed: () {
if (isWalk(item.format)) {
if (isWalk_(item.format)) {
Navigator.push(context, MaterialPageRoute(builder: (context) => WalkGlobalResultView(resultId: item.id!)));
} else {
Navigator.push(context, MaterialPageRoute(builder: (context) => SportGlobalResultView(resultId: item.id!)));
......@@ -38,7 +38,7 @@ class HistoryItemView extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
formattedDate(context, item),
_formattedDate(context, item),
style: const TextStyle(
inherit: true,
fontSize: 17,
......@@ -48,7 +48,7 @@ class HistoryItemView extends StatelessWidget {
),
const SizedBox(height: 3),
Text(
formattedLocation(context, item),
_formattedLocation(context, item),
style: const TextStyle(
inherit: true,
fontSize: 12,
......@@ -58,7 +58,7 @@ class HistoryItemView extends StatelessWidget {
),
const SizedBox(height: 2),
Text(
formattedTime(context, item),
_formattedTime(context, item),
style: const TextStyle(
inherit: true,
fontSize: 14,
......@@ -74,24 +74,24 @@ class HistoryItemView extends StatelessWidget {
);
}
String formattedLocation(BuildContext context, CourseResultEntity item) {
String _formattedLocation(BuildContext context, CourseResultEntity item) {
return Translations.getString("user_map_name") + " " + item.mapName;
}
String formattedDate(context, CourseResultEntity item) {
if (isWalk(item.format)) {
String _formattedDate(context, CourseResultEntity item) {
if (isWalk_(item.format)) {
return Translations.getString("walk_date") + " " + getLocalizedDate(item.date);
} else {
return Translations.getString("course_date") + " " + getLocalizedDate(item.date);
}
}
String formattedTime(BuildContext context, CourseResultEntity item) {
String _formattedTime(BuildContext context, CourseResultEntity item) {
return Translations.getString("course_time") + " " + getLocalizedTime(item.totalTime);
}
@visibleForTesting
static bool isWalk(format) {
static bool isWalk_(format) {
return format == CourseFormat.WALK_ORDER.index;
}
}
......@@ -18,7 +18,7 @@ String getLocalizedDate(int dateInMillisecondsSinceEpoch) {
@visibleForTesting
String getLocalizedDate_(int dateInMillisecondsSinceEpoch, String locale) {
var dateTime = DateTime.fromMillisecondsSinceEpoch(dateInMillisecondsSinceEpoch, isUtc: true);
var dateTime = DateTime.fromMillisecondsSinceEpoch(dateInMillisecondsSinceEpoch, isUtc: false);
final DateFormat formatter = DateFormat.yMMMd(locale).add_jm();
return formatter.format(dateTime);
}
......
......@@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 3.3.9+131
version: 3.3.9+132
environment:
sdk: ">=2.12.0 <3.0.0"
......
......@@ -3,8 +3,8 @@ import 'package:vikazimut/history/history_item_view.dart';
void main() {
test('Test isWalk when true', () async {
expect(HistoryItemView.isWalk(2), true);
expect(HistoryItemView.isWalk(0), false);
expect(HistoryItemView.isWalk(1), false);
expect(HistoryItemView.isWalk_(2), true);
expect(HistoryItemView.isWalk_(0), false);
expect(HistoryItemView.isWalk_(1), false);
});
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment