Skip to content

Instantly share code, notes, and snippets.

@shameemreza

shameemreza/main.dart Secret

Created Sep 29, 2020
Embed
What would you like to do?
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
You can’t perform that action at this time.