Skip to content

Instantly share code, notes, and snippets.

@shameemreza
Created September 29, 2020 08:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shameemreza/2af20f96c4583a8b3475018a14cc8456 to your computer and use it in GitHub Desktop.
Save shameemreza/2af20f96c4583a8b3475018a14cc8456 to your computer and use it in GitHub Desktop.
import 'package:flutter/material.dart';
import 'package:geolocator/geolocator.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: LocationApp(),
);
}
}
class LocationApp extends StatefulWidget {
@override
_LocationAppState createState() => _LocationAppState();
}
class _LocationAppState extends State<LocationApp> {
var _locationMessage = "";
void _getCurrentLocation() async {
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Location service"),
),
body: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text("${_locationMessage}"),
Center(
child: RaisedButton(
onPressed: () {
_getCurrentLocation();
},
child: Text("get location"),
),
),
],
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment