flutter_location_search 1.0.0 copy "flutter_location_search: ^1.0.0" to clipboard
flutter_location_search: ^1.0.0 copied to clipboard

Package that provides Place search using Open Street Map

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_location_search/flutter_location_search.dart';

void main() => runApp(const MyApp());

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  String _locationText = 'Tap here to search a place';

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Location Picker',
      debugShowCheckedModeBanner: false,
      home: Scaffold(
        body: Center(
          child: Builder(builder: (context) {
            return TextButton(
              child: Text(_locationText),
              onPressed: () async {
                LocationData? locationData = await LocationSearch.show(
                    context: context, lightAdress: true, mode: Mode.fullscreen);

                setState(() {
                  _locationText = locationData!.address;
                });
              },
            );
          }),
        ),
      ),
    );
  }
}
8
likes
0
pub points
81%
popularity

Publisher

unverified uploader

Package that provides Place search using Open Street Map

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter, geolocator, http, intl, latlong2, logger

More

Packages that depend on flutter_location_search