Fakultas Ilmu Komputer UI
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
bisago-fe
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
ppl-fasilkom-ui
PPL Sosial
bisago
bisago-fe
Commits
edd92302
Commit
edd92302
authored
5 years ago
by
Fakhira Devina
Browse files
Options
Downloads
Patches
Plain Diff
[CHORE] Change location package dependencies and add location
permission handler
parent
be96bc39
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/page/dashboard/dashboard.dart
+22
-0
22 additions, 0 deletions
lib/page/dashboard/dashboard.dart
pubspec.yaml
+1
-1
1 addition, 1 deletion
pubspec.yaml
with
23 additions
and
1 deletion
lib/page/dashboard/dashboard.dart
+
22
−
0
View file @
edd92302
...
...
@@ -25,6 +25,7 @@ class DashboardState extends State<Dashboard> {
void
initState
()
{
super
.
initState
();
location
=
new
Location
();
enableLocationService
();
location
.
onLocationChanged
()
.
listen
((
LocationData
cLoc
)
{
currentLocation
=
cLoc
;
updatePinOnMap
();
...
...
@@ -34,6 +35,27 @@ class DashboardState extends State<Dashboard> {
_markers
.
add
(
contohMarker
);
}
void
enableLocationService
()
async
{
bool
_serviceEnabled
;
PermissionStatus
_permissionGranted
;
_serviceEnabled
=
await
location
.
serviceEnabled
();
if
(
!
_serviceEnabled
)
{
_serviceEnabled
=
await
location
.
requestService
();
if
(
!
_serviceEnabled
)
{
return
;
}
}
_permissionGranted
=
await
location
.
hasPermission
();
if
(
_permissionGranted
==
PermissionStatus
.
DENIED
)
{
_permissionGranted
=
await
location
.
requestPermission
();
if
(
_permissionGranted
!=
PermissionStatus
.
GRANTED
)
{
return
;
}
}
}
void
_navigateToPencarianPage
(
BuildContext
context
)
{
final
route
=
MaterialPageRoute
(
builder:
(
_
)
=
>
Pencarian
());
Navigator
.
of
(
context
)
.
push
(
route
);
...
...
This diff is collapsed.
Click to expand it.
pubspec.yaml
+
1
−
1
View file @
edd92302
...
...
@@ -23,7 +23,7 @@ dependencies:
path_provider
:
^0.4.1
mockito
:
^4.1.1
intl
:
location
:
^2.
4.0
location
:
^2.
5.3
flutter_polyline_points
:
^0.1.0
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
...
...
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