google_maps_place_search_dencity 0.0.1
google_maps_place_search_dencity: ^0.0.1 copied to clipboard
Dencity Modified Search Package.
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:google_maps_place_search_dencity/google_maps_place_search_dencity.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Example of Google Maps Place Search Advance Package',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
home: const MyHomePage(),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key});
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
FocusNode? focusNode;
initState() {
super.initState();
focusNode = FocusNode();
}
dispose() {
focusNode!.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return SafeArea(
child: Scaffold(
body: Container(
child: SingleChildScrollView(
child: GooglePlaceSearchAdvance(
initialLatitude: 48.8566,
initialLongitude: 2.3522,
googleMapsApiKey: "GOOGLE_MAPS_API_KEY",
lightTheme: false,
country: "fr",
iconImagePath: "assets/search.png",
onLocationSelected: (double lat, double lng, String address,
String mainText, String imageURL) {
print("Coordinates are $lat,$lng");
print("Address is : $address");
print("Image URL is: $imageURL");
print("Main Text is: $mainText");
},
focusNode: focusNode!,
),
),
),
),
);
}
}