awesome_place_search 1.0.2-dev copy "awesome_place_search: ^1.0.2-dev" to clipboard
awesome_place_search: ^1.0.2-dev copied to clipboard

The awesome_place_search package is a Flutter library that provides a user interface for searching places using the Google Places API. With this package, you can easily implement a location search bar [...]

Awesome Place Search #

Clean Architecture and Bloc( without package )

Description #

The awesome_place_search package is a Flutter library that provides a user interface for searching places using the Google Places API. With this package, you can easily implement a location search bar that shows suggestions as the user types.

Installation #

Add pubspec.yaml #

dependencies:
  awesome_place_search: ^1.0.2

Usage #

Basic #

import 'package:flutter/material.dart';

import 'package:awesome_place_search/awesome_place_search.dart';

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

class MyApp extends StatefulWidget {

  PredictionModel? prediction;
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Welcome to Flutter',
      home: Scaffold(
        appBar: AppBar(
          title: Text('Welcome to Flutter'),
        ),
        body: Center(
          child: Text(prediction.description??"Prediction is null")
        ),
        floatingActionButton: FloatingActionButton(
            onPressed: () {
                _searchPlaces();
            },
            child: const Icon(Icons.add,
        ),
      ),
      ),
     
    );
  }

  void _searchPlaces(){
     AwesomeSearch(
        context: context,
        key: "Your Google map key",
        onTap: (value) async {
           final result = await value;
           setState(() {
                prediction=result;
            });
        },
    );
  }
}

Maintainer #

Demo #

Awesome Place Search Demo
19
likes
0
pub points
76%
popularity

Publisher

verified publisherloritotiago.pro

The awesome_place_search package is a Flutter library that provides a user interface for searching places using the Google Places API. With this package, you can easily implement a location search bar that shows suggestions as the user types.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

dartz, equatable, flutter, google_maps_webservice, http, skeletons

More

Packages that depend on awesome_place_search