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
51a49588
Commit
51a49588
authored
3 years ago
by
Maximilian Betz
Browse files
Options
Downloads
Patches
Plain Diff
text input validation halfway done
parent
a9bf4a1b
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/addevent.dart
+15
-1
15 additions, 1 deletion
lib/addevent.dart
lib/configuration.dart
+6
-2
6 additions, 2 deletions
lib/configuration.dart
with
21 additions
and
3 deletions
lib/addevent.dart
+
15
−
1
View file @
51a49588
...
...
@@ -124,6 +124,9 @@ class _AddEventPageState extends State<AddEvent> {
final
EventCurrentInstance
currentEvent
=
EventCurrentInstance
();
String
gnssStatusText
=
""
;
final
formKey
=
GlobalKey
<
FormState
>();
//key for form
if
(
true
==
syncGNSSData
){
// Update current event coordinates from GNSS stream
currentEvent
.
store
.
latitude
=
lat
;
...
...
@@ -149,12 +152,23 @@ class _AddEventPageState extends State<AddEvent> {
children:
<
Widget
>[
TextFormField
(
initialValue:
currentEvent
.
store
.
label
,
autovalidateMode:
AutovalidateMode
.
onUserInteraction
,
decoration:
const
InputDecoration
(
labelText:
'Label'
labelText:
'Label'
,
errorText:
'Only: a-z , A-Z , _ , 0-9 , ,(Comma) , ( , ) , + , - , . , :'
),
onChanged:
(
value
)
{
currentEvent
.
store
.
label
=
value
;
},
validator:
(
value
){
if
(
!
RegExp
(
r'^[a-z A-Z . \- 0-9 , ( ) + - _ :]+$'
)
.
hasMatch
(
value
!
)){
return
"Only: a-z , A-Z , _ , 0-9 , ,(Comma) , ( , ) , + , - , . , :"
;
}
else
{
currentEvent
.
store
.
label
=
value
;
return
''
;
// Entered Text is valid
}
},
),
DropdownButtonFormField
(
value:
currentEvent
.
store
.
type
,
...
...
This diff is collapsed.
Click to expand it.
lib/configuration.dart
+
6
−
2
View file @
51a49588
...
...
@@ -43,6 +43,8 @@ Future<List<Device>> updateDevices(int collectionId) async {
Future
<
List
<
Collection
>>
fetchCollections
()
async
{
debugPrint
(
"Fetching Collections..."
);
List
<
Collection
>
collectionList
=
[];
CollectionStoreInstance
collections
=
CollectionStoreInstance
();
final
response
=
await
http
.
get
(
Uri
.
parse
(
'https://sensor.awi.de/rest/sensors/collections/getAllCollections?pointInTime=2018-07-03T12%3A30%3A55.389Z'
));
...
...
@@ -73,7 +75,6 @@ class _MyHomePageState extends State<Configuration> {
@override
void
initState
()
{
super
.
initState
();
//futureCollection = fetchCollection();
futureCollections
=
fetchCollections
();
}
late
Future
<
String
>
eventTypes
;
...
...
@@ -109,10 +110,13 @@ class _MyHomePageState extends State<Configuration> {
/*Initialize active collection with first received
collection if not initialized yet*/
if
(
activeCollection
.
store
.
collectionName
==
''
){
if
(
activeCollection
.
store
.
id
==
-
1
){
activeCollection
.
store
=
collections
.
store
[
0
];
}
print
(
activeCollection
.
store
);
print
(
collections
.
store
);
return
DropdownButtonFormField
(
value:
activeCollection
.
store
.
collectionName
,
decoration:
const
InputDecoration
(
...
...
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