Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MobileEventLog
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Data-Logistics-Support
MobileEventLog
Commits
5cc95545
Commit
5cc95545
authored
3 years ago
by
Maximilian Betz
Browse files
Options
Downloads
Patches
Plain Diff
minor updated
parent
3726e09e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/viewevents.dart
+19
-9
19 additions, 9 deletions
lib/viewevents.dart
with
19 additions
and
9 deletions
lib/viewevents.dart
+
19
−
9
View file @
5cc95545
...
...
@@ -12,12 +12,15 @@ class ViewEvents extends StatefulWidget {
}
class
_ViewEvents
extends
State
<
ViewEvents
>
{
int
_synccounter
=
0
;
//For displaying progress during event upload
// Get singleton to access locally stored events:
EventStoreInstance
events
=
EventStoreInstance
();
//TODO: add exception handling and display exceptions to user.
Future
<
bool
>
syncEvents
()
async
{
final
EventStoreInstance
events
=
EventStoreInstance
();
//
final EventStoreInstance events = EventStoreInstance();
final
ConfigurationStoreInstance
configuration
=
ConfigurationStoreInstance
();
SensorConnector
connection
=
SensorConnector
();
int
_synccounter
=
0
;
//For displaying progress during event upload
String
?
token
=
await
connection
.
getAuthToken
(
configuration
.
loginInformation
.
mail
,
configuration
.
loginInformation
.
password
);
...
...
@@ -37,8 +40,8 @@ class _ViewEvents extends State<ViewEvents> {
_synccounter
--
;
debugPrint
(
'put success, remaining events: '
+
_synccounter
.
toString
());
event
.
status
=
'EXPORTED'
;
//Update event status so that it is only exported once.
setState
(()
{});
}
setState
(()
{});
}
}
return
true
;
...
...
@@ -48,17 +51,20 @@ class _ViewEvents extends State<ViewEvents> {
@override
Widget
build
(
BuildContext
context
)
{
// Get singleton to access locally stored events:
final
EventStoreInstance
events
=
EventStoreInstance
();
return
Scaffold
(
appBar:
AppBar
(
title:
const
Text
(
"View Added Events"
),
),
body:
SingleChildScrollView
(
body:
Container
(
margin:
const
EdgeInsets
.
symmetric
(
horizontal:
5.0
),
child:
SingleChildScrollView
(
scrollDirection:
Axis
.
horizontal
,
child:
SingleChildScrollView
(
scrollDirection:
Axis
.
vertical
,
child:
DataTable
(
columns:
const
<
DataColumn
>[
DataColumn
(
label:
Text
(
...
...
@@ -184,7 +190,9 @@ class _ViewEvents extends State<ViewEvents> {
DataCell
(
TextFormField
(
readOnly:
true
,
initialValue:
event
.
status
,
controller:
TextEditingController
(
//Required to update field here
text:
event
.
status
,
),
onFieldSubmitted:
(
val
)
{
event
.
status
=
val
;
//Update Database
},
...
...
@@ -196,9 +204,11 @@ class _ViewEvents extends State<ViewEvents> {
),
),
),
),
bottomNavigationBar:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
en
d
,
mainAxisAlignment:
MainAxisAlignment
.
spaceBetwe
en
,
children:
[
Text
(
'Remaining events to sync: '
+
events
.
getPendingEventCount
()
.
toString
()),
FloatingActionButton
.
extended
(
heroTag:
null
,
tooltip:
'Upload Events'
,
...
...
@@ -231,7 +241,7 @@ class _ViewEvents extends State<ViewEvents> {
//Text("Progress"),
const
CircularProgressIndicator
(),
const
SizedBox
(
height:
10
),
Text
(
'Remaining events to sync
: '
+
_synccounter
.
toString
()
),
Text
(
'Remaining events to sync
'
),
],
),
actions:
<
Widget
>[
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment