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
c62aede3
Commit
c62aede3
authored
3 years ago
by
Maximilian Betz
Browse files
Options
Downloads
Patches
Plain Diff
selecting collection ui works
parent
15be6cd1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
lib/addevent.dart
+1
-0
1 addition, 0 deletions
lib/addevent.dart
lib/configuration.dart
+15
-20
15 additions, 20 deletions
lib/configuration.dart
lib/datamodel.dart
+11
-1
11 additions, 1 deletion
lib/datamodel.dart
with
27 additions
and
21 deletions
lib/addevent.dart
+
1
−
0
View file @
c62aede3
...
@@ -109,6 +109,7 @@ class _AddEventPageState extends State<AddEvent> {
...
@@ -109,6 +109,7 @@ class _AddEventPageState extends State<AddEvent> {
currentEvent
.
store
.
latitude
,
currentEvent
.
store
.
latitude
,
currentEvent
.
store
.
longitude
,
currentEvent
.
store
.
longitude
,
currentEvent
.
store
.
elevation
currentEvent
.
store
.
elevation
//TODO: add timestamp! Begin & End
));
));
}
}
...
...
This diff is collapsed.
Click to expand it.
lib/configuration.dart
+
15
−
20
View file @
c62aede3
...
@@ -66,8 +66,8 @@ class _MyHomePageState extends State<Configuration> {
...
@@ -66,8 +66,8 @@ class _MyHomePageState extends State<Configuration> {
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
final
CollectionStoreInstance
storedC
ollections
=
CollectionStoreInstance
();
final
CollectionStoreInstance
c
ollections
=
CollectionStoreInstance
();
final
CollectionCurrentInstance
current
Collection
=
CollectionCurrentInstance
();
final
CollectionCurrentInstance
active
Collection
=
CollectionCurrentInstance
();
return
Scaffold
(
return
Scaffold
(
appBar:
AppBar
(
appBar:
AppBar
(
...
@@ -82,26 +82,33 @@ class _MyHomePageState extends State<Configuration> {
...
@@ -82,26 +82,33 @@ class _MyHomePageState extends State<Configuration> {
builder:
(
context
,
snapshot
){
builder:
(
context
,
snapshot
){
if
(
snapshot
.
hasData
)
if
(
snapshot
.
hasData
)
{
{
debugPrint
(
'Got collections:'
);
collections
.
store
=
[];
//debugPrint('Got Collections:');
snapshot
.
data
?.
forEach
((
element
)
{
snapshot
.
data
?.
forEach
((
element
)
{
debugPrint
(
element
.
id
.
toString
()
+
' '
+
element
.
toString
()
+
' #'
+
element
.
description
.
toString
());
//debugPrint(element.id.toString() + ' ' + element.collectionName.toString() + ' #' + element.description.toString());
collections
.
store
.
add
(
element
);
});
});
/*Initialize active collection with first received collection if not initialized yet*/
if
(
activeCollection
.
store
.
collectionName
==
''
){
activeCollection
.
store
=
collections
.
store
[
0
];
}
return
DropdownButtonFormField
(
return
DropdownButtonFormField
(
value:
current
Collection
.
store
.
collectionName
,
value:
active
Collection
.
store
.
collectionName
,
decoration:
const
InputDecoration
(
decoration:
const
InputDecoration
(
labelText:
'Chose
n
Collection'
,
labelText:
'Chose Collection'
,
),
),
items:
items:
storedC
ollections
.
store
.
map
((
Collection
collection
)
{
c
ollections
.
store
.
map
((
Collection
collection
)
{
return
DropdownMenuItem
(
return
DropdownMenuItem
(
value:
collection
.
collectionName
,
value:
collection
.
collectionName
,
child:
Text
(
collection
.
collectionName
),
child:
Text
(
collection
.
collectionName
),
);
);
})
.
toList
(),
})
.
toList
(),
onChanged:
(
value
)
{
onChanged:
(
value
)
{
current
Collection
.
store
.
c
ollectionName
=
value
.
toString
();
active
Collection
.
store
=
collections
.
getC
ollection
From
Name
(
value
.
toString
()
)
;
}
}
);
);
}
}
...
@@ -110,18 +117,6 @@ class _MyHomePageState extends State<Configuration> {
...
@@ -110,18 +117,6 @@ class _MyHomePageState extends State<Configuration> {
}
}
}
}
),
),
FutureBuilder
<
Collection
>(
future:
futureCollection
,
builder:
(
context
,
snapshot
){
if
(
snapshot
.
hasData
)
{
return
Text
(
snapshot
.
data
!.
collectionName
);
}
else
{
return
const
CircularProgressIndicator
();
}
}
),
],
],
),
),
),
),
...
...
This diff is collapsed.
Click to expand it.
lib/datamodel.dart
+
11
−
1
View file @
c62aede3
...
@@ -109,6 +109,16 @@ class EventType{
...
@@ -109,6 +109,16 @@ class EventType{
abstract
class
CollectionStoreBase
{
abstract
class
CollectionStoreBase
{
List
<
Collection
>
store
=
[];
List
<
Collection
>
store
=
[];
Collection
getCollectionFromName
(
String
name
)
{
for
(
var
collection
in
store
)
{
if
(
collection
.
collectionName
==
name
)
{
return
collection
;
}
}
throw
Exception
(
'Event with name :'
+
name
+
' was not found.'
);
}
}
}
class
CollectionStoreInstance
extends
CollectionStoreBase
{
class
CollectionStoreInstance
extends
CollectionStoreBase
{
...
@@ -157,7 +167,7 @@ abstract class EventCurrentBase{
...
@@ -157,7 +167,7 @@ abstract class EventCurrentBase{
}
}
abstract
class
CollectionCurrentBase
{
abstract
class
CollectionCurrentBase
{
Collection
store
=
Collection
(
id:
-
1
,
description:
'
description
'
,
collectionName:
'
name
'
);
Collection
store
=
Collection
(
id:
-
1
,
description:
''
,
collectionName:
''
);
}
}
abstract
class
EventTypeStoreBase
{
abstract
class
EventTypeStoreBase
{
...
...
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