longpress_popup 3.0.0 copy "longpress_popup: ^3.0.0" to clipboard
longpress_popup: ^3.0.0 copied to clipboard

This Flutter package extends flutter_map to easily show customizable popups when markers are long-pressed. It lets you add images, text, and buttons, and provides methods to programmatically show or h [...]

longpress_popup #

This is a Fork of flutter_map_marker_popup by @rorystephenson. #

pub package pub likes pub points platform

GitHub stars GitHub issues GitHub license GitHub last commit

Build status

Flutter Map Custom Marker Popups is an extension for the popular Flutter Map package. It allows you to create custom markers that, when long-pressed, open customizable popups containing additional data associated with the marker. This package enhances the interactivity and visual appeal of maps in your Flutter applications.

Features #

  • Customizable Markers: Create custom markers with images, icons, or other widgets.
  • Interactive Popups: Popups open on long-press and can contain rich data.
  • Data Integration: Associate custom data with each marker and display it in the popup.
  • Styling Options: Customize marker and popup appearance to match your app's design.
  • Easy Integration: Seamlessly integrate with Flutter Map for powerful map displays.

Installation #

To use this package, add longpress_popup as a dependency in your pubspec.yaml file:

dependencies:
  longpress_popup: ^1.0.0

If you have any suggestions/problems please don't hesitate to open an issue.

Getting Started #

For a minimal code example have a look at SimpleMapWithPopups.

Usage #

Import the package:

import 'package:flutter_map_custom_marker_popups/flutter_map_custom_marker_popups.dart';

Create a FlutterMap widget and add a MarkerLayer:

FlutterMap(
  options: MapOptions(
    // set your map options here
  ),
  layers: [
    TileLayerOptions(
      // set your tile layer options here
    ),
    MarkerLayer(
      markers: [
        CustomMarker(
          // Customize your marker here
          point: LatLng(51.5, -0.09), // Marker position
          builder: (BuildContext context) {
            return MarkerWidget(); // Your custom marker widget
          },
          popupBuilder: (BuildContext context, CustomMarker marker) {
            return MyCustomPopup(marker.data); // Your custom popup widget
          },
          data: MyMarkerData(/* Your data here */),
        ),
        // Add more markers as needed
      ],
    ),
  ],
)

For a complete example which demonstrates all of the various options available try running the demo app in the example/ directory which results in the following:

Example

FAQ #

  • Why is the popup not showing when I long press the marker?

    Make sure you don't have a GestureDetector in your Marker's builder which is preventing this plugin from detecting the Marker long press.

"# longpress_popup"

Contributing #

Contributions to this package are welcome! Feel free to open issues or pull requests to suggest improvements or report bugs.

License #

This project is licensed under the MIT License - see the LICENSE.md file for details.

Acknowledgments #

  • Mention any contributors or libraries used in this package.
  • Provide links to relevant resources or tutorials.

Please make sure to customize this Markdown text with your specific package details and replace placeholders accordingly.

🔗 More Packages #


👨‍💻 Developer Card #

Younes M'rabti avatar

Younes M'rabti #

📧 Email: admin@youmti.net
🌐 Website: youmti.net
💼 LinkedIn: younesmrabti1996

2
likes
0
points
192
downloads

Publisher

verified publisheryoumti.net

Weekly Downloads

This Flutter package extends flutter_map to easily show customizable popups when markers are long-pressed. It lets you add images, text, and buttons, and provides methods to programmatically show or hide popups—making map interactions simple and seamless.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, flutter_map, latlong2, vector_math

More

Packages that depend on longpress_popup