Skip to content

Commit

Permalink
Fixed Bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
shyvum committed Jul 1, 2019
1 parent 18a14c0 commit 9833e46
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 44 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ android {

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "tk.shivamgoyal.google_maps_in_flutter"
minSdkVersion 16
applicationId "co.shivamgoyal.googleofficelocations"
minSdkVersion 21
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
Expand Down
2 changes: 1 addition & 1 deletion android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="tk.shivamgoyal.google_maps_in_flutter">
package="co.shivamgoyal.googleofficelocations">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
Expand Down
4 changes: 1 addition & 3 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="tk.shivamgoyal.google_maps_in_flutter">
package="co.shivamgoyal.googleofficelocations">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package tk.shivamgoyal.google_maps_in_flutter;
package co.shivamgoyal.googleofficelocations;

import android.os.Bundle;
import io.flutter.app.FlutterActivity;
Expand Down
2 changes: 1 addition & 1 deletion android/app/src/profile/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="tk.shivamgoyal.google_maps_in_flutter">
package="co.shivamgoyal.googleofficelocations">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
Expand Down
28 changes: 0 additions & 28 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'package:flutter/material.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:permission_handler/permission_handler.dart';
import 'src/locations.dart' as locations;

void main() => runApp(MyApp());
Expand All @@ -11,32 +10,9 @@ class MyApp extends StatefulWidget {
}

class _MyAppState extends State<MyApp> {
PermissionStatus _status;

@override
void initState() {
super.initState();
PermissionHandler()
.checkPermissionStatus(PermissionGroup.locationWhenInUse)
.then(_updateStatus);
}

void _updateStatus(PermissionStatus status) {
if (status != _status) {
setState(() {
_status = status;
});
}
}

void _askPermission() {
PermissionHandler().requestPermissions(
[PermissionGroup.locationWhenInUse]).then(_onStatusRequested);
}

void _onStatusRequested(Map<PermissionGroup, PermissionStatus> statuses) {
final status = statuses[PermissionGroup.locationWhenInUse];
_updateStatus(status);
}

final Map<String, Marker> _markers = {};
Expand Down Expand Up @@ -64,9 +40,6 @@ class _MyAppState extends State<MyApp> {
debugShowCheckedModeBanner: false,
home: Scaffold(
appBar: AppBar(
actions: <Widget>[
IconButton(icon: Icon(Icons.my_location), onPressed: _askPermission)
],
title: const Text('Google Office Locations'),
backgroundColor: Colors.white,
),
Expand All @@ -81,7 +54,6 @@ class _MyAppState extends State<MyApp> {
tiltGesturesEnabled: true,
compassEnabled: true,
rotateGesturesEnabled: true,
myLocationEnabled: true,
),
),
theme: ThemeData(
Expand Down
7 changes: 0 additions & 7 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -305,13 +305,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.5.0"
permission_handler:
dependency: "direct main"
description:
name: permission_handler
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
pool:
dependency: transitive
description:
Expand Down
4 changes: 3 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: GoogleOfficeLocations
description: An app featuring Google office locations on Map using the Flutter SDK.
version: 1.0.0+1
author: Shivam Goyal
homepage: https://shivamgoyal.co
repository: https://github.com/ShivamGoyal1899/GoogleOfficeLocations

environment:
sdk: ">=2.1.0 <3.0.0"
Expand All @@ -12,7 +15,6 @@ dependencies:
http: ^0.12.0+1
json_serializable: ^2.0.2
cupertino_icons: ^0.1.2
permission_handler: 2.1.0

dev_dependencies:
flutter_test:
Expand Down

0 comments on commit 9833e46

Please sign in to comment.