map_autocomplete_field 0.0.1 copy "map_autocomplete_field: ^0.0.1" to clipboard
map_autocomplete_field: ^0.0.1 copied to clipboard

A TextField, with a DropDown to easily integrate Google Places API in flutter

example/lib/main.dart

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

void main() {
  runApp(const MyApp());
}

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

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

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
  }

  final TextEditingController addressCtrl = TextEditingController();

  final String yourMapApiKey = '';

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('MapTypeAheadField Demo'),
        ),
        body: Padding(
          padding: const EdgeInsets.symmetric(vertical: 25, horizontal: 25.0),
          child: MapAutoCompleteField(
            googleMapApiKey: yourMapApiKey,
            controller: addressCtrl,
            itemBuilder: (BuildContext context, suggestion) {
              return ListTile(
                title: Text(suggestion.description),
              );
            },
            onSuggestionSelected: (suggestion) {
              addressCtrl.text = suggestion.description;
            },
          ),
        ),
      ),
    );
  }
}
3
likes
130
points
520
downloads

Publisher

unverified uploader

Weekly Downloads

A TextField, with a DropDown to easily integrate Google Places API in flutter

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

dio, flutter, flutter_typeahead, plugin_platform_interface, uuid

More

Packages that depend on map_autocomplete_field

Packages that implement map_autocomplete_field