Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PROG2900
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
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
Sara Savanovic Djordjevic
PROG2900
Commits
06fa41eb
Commit
06fa41eb
authored
9 months ago
by
Sara Savanovic Djordjevic
Browse files
Options
Downloads
Patches
Plain Diff
fix: start of fixing search bug
parent
4f2bee72
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/lib/pages/default_page.dart
+6
-7
6 additions, 7 deletions
app/lib/pages/default_page.dart
app/lib/server_requests/init_state.dart
+4
-4
4 additions, 4 deletions
app/lib/server_requests/init_state.dart
app/lib/widgets/choropleth_map.dart
+4
-2
4 additions, 2 deletions
app/lib/widgets/choropleth_map.dart
with
14 additions
and
13 deletions
app/lib/pages/default_page.dart
+
6
−
7
View file @
06fa41eb
...
...
@@ -62,15 +62,14 @@ class _DefaultPageState extends State<DefaultPage> {
context:
context
,
delegate:
CustomSearchDelegate
((
String
result
)
{
// Make request only if the selected lake is different from the current selected lake
if
(
result
!=
selectedLake
)
{
setState
(()
{
//selectedLake = result;
initialiseState
(
false
);
});
//if (result != selectedLake) {
Future
.
microtask
(()
async
{
// Reinitialise state with new lake data
selectedLake
=
result
;
await
initialiseState
(
false
);
setState
(()
{
selectedLake
=
result
;
});
});
}
//
}
}),
);
},
...
...
This diff is collapsed.
Click to expand it.
app/lib/server_requests/init_state.dart
+
4
−
4
View file @
06fa41eb
...
...
@@ -26,7 +26,7 @@ Future<void> initialiseState(bool initNewLake) async {
List
<
Measurement
>
measurements
=
fetchResult
.
measurements
;
selectedMeasurements
=
measurements
;
// Extract all
_
subdivisions from list of measurements
// Extract all subdivisions from list of measurements
for
(
Measurement
measurement
in
measurements
)
{
for
(
SubDiv
subdivision
in
measurement
.
subDivs
)
{
selectedSubdivisions
.
add
(
subdivision
);
...
...
@@ -35,10 +35,9 @@ Future<void> initialiseState(bool initNewLake) async {
// Sort the list of SubDiv objects based on each subdivision id
selectedSubdivisions
.
sort
((
a
,
b
)
=
>
a
.
sub_div_id
.
compareTo
(
b
.
sub_div_id
));
print
(
"Loaded from files: Meas.len:
${selectedMeasurements.length}
, rel.len:
${selectedRelation.length}
"
);
}
else
{
// Try to fetch measurement data from server
selectedSubdivisions
.
clear
();
// Reset subdivision list
markerListFuture
=
fetchMeasurements
()
.
then
((
fetchResult
)
{
List
<
Measurement
>
measurements
=
fetchResult
.
measurements
;
selectedMeasurements
=
measurements
;
...
...
@@ -47,6 +46,7 @@ Future<void> initialiseState(bool initNewLake) async {
for
(
Measurement
measurement
in
measurements
)
{
for
(
SubDiv
subdivision
in
measurement
.
subDivs
)
{
selectedSubdivisions
.
add
(
subdivision
);
print
(
"Added subdivision"
);
}
}
...
...
This diff is collapsed.
Click to expand it.
app/lib/widgets/choropleth_map.dart
+
4
−
2
View file @
06fa41eb
...
...
@@ -33,13 +33,15 @@ class ChoroplethMapState extends State<ChoroplethMap> {
late
final
MapZoomPanBehavior
_zoomPanBehavior
=
MapZoomPanBehavior
();
void
updateDataSource
()
{
_initDataSource
();
setState
(()
{
selectedIndex
=
-
1
;
_initDataSource
();
});
}
@override
void
initState
()
{
super
.
initState
();
selectedIndex
=
0
;
_initDataSource
();
}
...
...
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