Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
CLOUARD Regis
Vikazimut-App
Commits
9da8c1b0
Commit
9da8c1b0
authored
Jun 03, 2022
by
CLOUARD Regis
Browse files
Merge branch '103_Limit-Kalman-correction' into 'master'
103 limit kalman correction See merge request
!90
parents
30b787ea
13ee4ca4
Changes
4
Hide whitespace changes
Inline
Side-by-side
lib/history/history_item_view.dart
View file @
9da8c1b0
...
...
@@ -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
;
}
}
lib/utils/time.dart
View file @
9da8c1b0
...
...
@@ -18,7 +18,7 @@ String getLocalizedDate(int dateInMillisecondsSinceEpoch) {
@visibleForTesting
String
getLocalizedDate_
(
int
dateInMillisecondsSinceEpoch
,
String
locale
)
{
var
dateTime
=
DateTime
.
fromMillisecondsSinceEpoch
(
dateInMillisecondsSinceEpoch
,
isUtc:
tru
e
);
var
dateTime
=
DateTime
.
fromMillisecondsSinceEpoch
(
dateInMillisecondsSinceEpoch
,
isUtc:
fals
e
);
final
DateFormat
formatter
=
DateFormat
.
yMMMd
(
locale
)
.
add_jm
();
return
formatter
.
format
(
dateTime
);
}
...
...
pubspec.yaml
View file @
9da8c1b0
...
...
@@ -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+13
1
version
:
3.3.9+13
2
environment
:
sdk
:
"
>=2.12.0
<3.0.0"
...
...
test/history/history_item_view_test.dart
View file @
9da8c1b0
...
...
@@ -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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment