flutter_w3w_map 1.0.1 copy "flutter_w3w_map: ^1.0.1" to clipboard
flutter_w3w_map: ^1.0.1 copied to clipboard

A Flutter package that integrates What3Words with Google Maps, allowing for easy 3-word address conversions and grid rendering.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_w3w_map/w3w_google_maps.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';


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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'W3W Google Maps Example',
      theme: ThemeData(
        primarySwatch: Colors.blue,
        useMaterial3: true,
      ),
      home: const ExampleScreen(),
    );
  }
}

class ExampleScreen extends StatelessWidget {
  const ExampleScreen({super.key});

  @override
  Widget build(BuildContext context) {
    // Provide your W3W API key here
    const String w3wApiKey = "YOUR_WHAT3WORDS_API_KEY";

    return W3WGoogleMaps.provider(
      w3wApiKey: w3wApiKey,
      child: Scaffold(
        appBar: AppBar(
          title: const Text('W3W Google Maps Demo'),
        ),
        body: W3WGoogleMap(
          initialCameraPosition: const CameraPosition(
            target: LatLng(23.0225, 72.5714),
            zoom: 12,
          ),
          onW3WSelected: (w3w) {
            debugPrint('Selected What3Words address: ///${w3w.words}');
          },
          markers: {
            const Marker(
              markerId: MarkerId('initial_location'),
              position: LatLng(23.0225, 72.5714),
              infoWindow: InfoWindow(
                title: 'Starting Point',
                snippet: 'Ahmedabad, India',
              ),
            ),
          },
        ),
      ),
    );
  }
}
4
likes
135
points
282
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A Flutter package that integrates What3Words with Google Maps, allowing for easy 3-word address conversions and grid rendering.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

cupertino_icons, flutter, geolocator, google_maps_flutter, http, permission_handler, provider

More

Packages that depend on flutter_w3w_map