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
730d082f
Commit
730d082f
authored
3 years ago
by
Maximilian Betz
Browse files
Options
Downloads
Patches
Plain Diff
implemented selection of Event Type
parent
073161a2
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
lib/addevent.dart
+11
-11
11 additions, 11 deletions
lib/addevent.dart
lib/datamodel.dart
+15
-0
15 additions, 0 deletions
lib/datamodel.dart
lib/main.dart
+13
-2
13 additions, 2 deletions
lib/main.dart
with
39 additions
and
13 deletions
lib/addevent.dart
+
11
−
11
View file @
730d082f
...
...
@@ -5,7 +5,9 @@ import 'datamodel.dart';
class
AddEvent
extends
StatelessWidget
{
@override
Widget
build
(
BuildContext
context
)
{
/* Get singletons to access relevant data here.*/
final
EventTypeStoreInstance
eventTypes
=
EventTypeStoreInstance
();
final
EventCurrentInstance
currentEvent
=
EventCurrentInstance
();
return
Scaffold
(
appBar:
AppBar
(
title:
const
Text
(
"Add Event"
)),
...
...
@@ -19,21 +21,19 @@ class AddEvent extends StatelessWidget {
),
),
DropdownButtonFormField
(
value:
currentEvent
.
store
.
type
,
decoration:
const
InputDecoration
(
labelText:
'Event Type'
,
),
items:
[
DropdownMenuItem
(
child:
Text
(
'Calibration'
),
value:
'Calibration'
,
),
DropdownMenuItem
(
child:
Text
(
'Information'
),
value:
'Information'
,
)
],
items:
eventTypes
.
store
.
map
((
EventType
event
)
{
return
DropdownMenuItem
(
value:
event
.
name
,
child:
Text
(
event
.
name
),
);
})
.
toList
(),
onChanged:
(
value
)
{
currentEvent
.
store
.
type
=
value
.
toString
();
}
),
DropdownButtonFormField
(
...
...
This diff is collapsed.
Click to expand it.
lib/datamodel.dart
+
15
−
0
View file @
730d082f
...
...
@@ -36,6 +36,9 @@ abstract class EventStoreBase{
List
<
Event
>
store
=
[];
}
abstract
class
EventCurrentBase
{
Event
store
=
Event
(
0
,
'urn0'
,
''
,
''
,
''
,
'PENDING'
);
}
...
...
@@ -69,6 +72,18 @@ class EventStoreInstance extends EventStoreBase {
}
}
class
EventCurrentInstance
extends
EventCurrentBase
{
static
final
EventCurrentInstance
_instance
=
EventCurrentInstance
.
_internal
();
factory
EventCurrentInstance
(){
return
_instance
;
}
EventCurrentInstance
.
_internal
(){
store
=
Event
(
0
,
'urn0'
,
''
,
''
,
''
,
'PENDING'
);
}
}
class
EventTypeStoreInstance
extends
EventTypeStoreBase
{
static
final
EventTypeStoreInstance
_instance
=
EventTypeStoreInstance
.
_internal
();
...
...
This diff is collapsed.
Click to expand it.
lib/main.dart
+
13
−
2
View file @
730d082f
...
...
@@ -7,12 +7,23 @@ import 'viewevents.dart';
import
'overview.dart'
;
import
'configuration.dart'
;
void
main
()
{
EventStoreInstance
events
=
EventStoreInstance
();
EventTypeStoreInstance
eventTypes
=
EventTypeStoreInstance
();
EventCurrentInstance
currentEvent
=
EventCurrentInstance
();
// Create current event as basis when starting add event widget
currentEvent
.
store
.
urn
=
'ADCP'
;
currentEvent
.
store
.
id
=
1234
;
currentEvent
.
store
.
description
=
'blabla'
;
currentEvent
.
store
.
label
=
'PS129_ABC'
;
currentEvent
.
store
.
type
=
'Deployment'
;
//Add some dummy events to eventstore
events
.
store
.
add
(
Event
.
fromJson
({
...
...
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