cpn_directory_webview

A Flutter widget for displaying the Central Pattana (CPN) directory map in a WebView with location permission support.

Features

  • Show CPN directory map in an in-app WebView
  • Request and handle location permission
  • Pass mall slug to show specific mall directory
  • Callback for user agent string

Getting started

Add this package to your pubspec.yaml:

dependencies:
  cpn_directory_webview: ^0.0.2

Then run:

flutter pub get

Usage

import 'package:cpn_directory_webview/cpn_directory_webview.dart';

LocationWebView(
  mallSlug: 'centralworld', // optional
  title: 'CentralWorld Directory', // optional
  onUserAgent: (userAgent) {
    print('UserAgent: $userAgent');
  },
)

Permissions

This package uses location permission. Make sure to add the following to your platform-specific files:

Android:
Add to android/app/src/main/AndroidManifest.xml:

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>

iOS:
Add to ios/Runner/Info.plist:

<key>NSLocationWhenInUseUsageDescription</key>
<string>This app needs access to your location to show the map.</string>

Additional information

Feel free to contribute or open issues on GitHub.

Licensed under the MIT License.