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
1bd551a8
Commit
1bd551a8
authored
1 year ago
by
Sara Savanovic Djordjevic
Browse files
Options
Downloads
Patches
Plain Diff
add: reload page animation
parent
35b1d6f6
No related branches found
Branches containing commit
No related tags found
1 merge request
!12
Clhp map
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/lib/pages/default_page.dart
+22
-33
22 additions, 33 deletions
app/lib/pages/default_page.dart
app/pubspec.lock
+8
-0
8 additions, 0 deletions
app/pubspec.lock
app/pubspec.yaml
+1
-0
1 addition, 0 deletions
app/pubspec.yaml
with
31 additions
and
33 deletions
app/lib/pages/default_page.dart
+
22
−
33
View file @
1bd551a8
import
'dart:async'
;
import
'package:app/server_requests/fetch_relation.dart'
;
import
'package:flutter/material.dart'
;
import
'package:liquid_pull_to_refresh/liquid_pull_to_refresh.dart'
;
import
'../consts.dart'
;
import
'../data_classes.dart'
;
...
...
@@ -27,35 +28,15 @@ class _DefaultPageState extends State<DefaultPage> {
super
.
dispose
();
}
/// Display message to user
void
showConnectionMessage
()
{
showDialog
(
context:
context
,
builder:
(
context
)
=
>
AlertDialog
(
actions:
[
TextButton
(
onPressed:
()
{
Navigator
.
of
(
context
)
.
pop
();
},
child:
const
Text
(
"Ok"
),
)
],
title:
const
Center
(
child:
Text
(
"No server connection"
)
),
contentPadding:
const
EdgeInsets
.
all
(
10.0
),
content:
const
Text
(
"The app may display outdated information. Use with caution!"
,
textAlign:
TextAlign
.
center
,
// Align text center
),
),
);
Future
<
void
>
_handleRefresh
()
async
{
return
await
Future
.
delayed
(
const
Duration
(
seconds:
2
));
}
@override
Widget
build
(
BuildContext
context
)
{
return
MaterialApp
(
home:
Scaffold
(
backgroundColor:
Colors
.
grey
[
900
],
appBar:
AppBar
(
backgroundColor:
Colors
.
black87
,
leading:
IconButton
(
...
...
@@ -101,16 +82,24 @@ class _DefaultPageState extends State<DefaultPage> {
),
],
),
body:
Container
(
// Return container with list view and background color
color:
const
Color
(
0xff151515
),
child:
ListView
(
children:
[
MapContainerWidget
(
markerList:
selectedMarkerList
,
relation:
selectedRelation
,
serverConnection:
serverConnection
,
),
],
body:
LiquidPullToRefresh
(
color:
Colors
.
grey
[
900
],
height:
200
,
backgroundColor:
Colors
.
grey
[
600
],
onRefresh:
_handleRefresh
,
animSpeedFactor:
3
,
showChildOpacityTransition:
false
,
child:
Container
(
// Return main container with map and stats widget
color:
const
Color
(
0xff151515
),
child:
ListView
(
children:
[
MapContainerWidget
(
markerList:
selectedMarkerList
,
relation:
selectedRelation
,
serverConnection:
serverConnection
,
),
],
),
),
),
),
...
...
This diff is collapsed.
Click to expand it.
app/pubspec.lock
+
8
−
0
View file @
1bd551a8
...
...
@@ -248,6 +248,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.1"
liquid_pull_to_refresh:
dependency: "direct main"
description:
name: liquid_pull_to_refresh
sha256: "11e4cd8c5460085a31b479ec4e1cd063eb8e599f35684d57a44dafa1fd1f67f3"
url: "https://pub.dev"
source: hosted
version: "3.0.1"
lists:
dependency: transitive
description:
...
...
This diff is collapsed.
Click to expand it.
app/pubspec.yaml
+
1
−
0
View file @
1bd551a8
...
...
@@ -22,6 +22,7 @@ dependencies:
fuzzy
:
any
# Search algorithm
connectivity_plus
:
^3.0.3
# Check internet connection
get
:
^4.6.5
liquid_pull_to_refresh
:
^3.0.0
# Pull to refresh
dev_dependencies
:
flutter_test
:
...
...
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