-
-
Notifications
You must be signed in to change notification settings - Fork 866
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add secondary tap to MapOptions (#1448)
* re-implemented PositionedTapDetector2 * updated example * updated macos build files * onSecondaryTap working * removed onTap action
- Loading branch information
1 parent
351dc78
commit ac15548
Showing
45 changed files
with
1,791 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,45 @@ | ||
# This file tracks properties of this Flutter project. | ||
# Used by Flutter tool to assess capabilities and perform upgrades etc. | ||
# | ||
# This file should be version controlled and should not be manually edited. | ||
# This file should be version controlled. | ||
|
||
version: | ||
revision: 8962f6dc68ec8e2206ac2fa874da4a453856c7d3 | ||
revision: 135454af32477f815a7525073027a3ff9eff1bfd | ||
channel: stable | ||
|
||
project_type: app | ||
|
||
# Tracks metadata for the flutter migrate command | ||
migration: | ||
platforms: | ||
- platform: root | ||
create_revision: 135454af32477f815a7525073027a3ff9eff1bfd | ||
base_revision: 135454af32477f815a7525073027a3ff9eff1bfd | ||
- platform: android | ||
create_revision: 135454af32477f815a7525073027a3ff9eff1bfd | ||
base_revision: 135454af32477f815a7525073027a3ff9eff1bfd | ||
- platform: ios | ||
create_revision: 135454af32477f815a7525073027a3ff9eff1bfd | ||
base_revision: 135454af32477f815a7525073027a3ff9eff1bfd | ||
- platform: linux | ||
create_revision: 135454af32477f815a7525073027a3ff9eff1bfd | ||
base_revision: 135454af32477f815a7525073027a3ff9eff1bfd | ||
- platform: macos | ||
create_revision: 135454af32477f815a7525073027a3ff9eff1bfd | ||
base_revision: 135454af32477f815a7525073027a3ff9eff1bfd | ||
- platform: web | ||
create_revision: 135454af32477f815a7525073027a3ff9eff1bfd | ||
base_revision: 135454af32477f815a7525073027a3ff9eff1bfd | ||
- platform: windows | ||
create_revision: 135454af32477f815a7525073027a3ff9eff1bfd | ||
base_revision: 135454af32477f815a7525073027a3ff9eff1bfd | ||
|
||
# User provided section | ||
|
||
# List of Local paths (relative to this file) that should be | ||
# ignored by the migrate tool. | ||
# | ||
# Files that are not part of the templates will be ignored by default. | ||
unmanaged_files: | ||
- 'lib/main.dart' | ||
- 'ios/Runner.xcodeproj/project.pbxproj' |
6 changes: 6 additions & 0 deletions
6
example/android/app/src/main/kotlin/me/jpryan/example/MainActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package me.jpryan.example | ||
|
||
import io.flutter.embedding.android.FlutterActivity | ||
|
||
class MainActivity: FlutterActivity() { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Uncomment this line to define a global platform for your project | ||
# platform :ios, '11.0' | ||
|
||
# CocoaPods analytics sends network stats synchronously affecting flutter build latency. | ||
ENV['COCOAPODS_DISABLE_STATS'] = 'true' | ||
|
||
project 'Runner', { | ||
'Debug' => :debug, | ||
'Profile' => :release, | ||
'Release' => :release, | ||
} | ||
|
||
def flutter_root | ||
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) | ||
unless File.exist?(generated_xcode_build_settings_path) | ||
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" | ||
end | ||
|
||
File.foreach(generated_xcode_build_settings_path) do |line| | ||
matches = line.match(/FLUTTER_ROOT\=(.*)/) | ||
return matches[1].strip if matches | ||
end | ||
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" | ||
end | ||
|
||
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) | ||
|
||
flutter_ios_podfile_setup | ||
|
||
target 'Runner' do | ||
use_frameworks! | ||
use_modular_headers! | ||
|
||
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) | ||
end | ||
|
||
post_install do |installer| | ||
installer.pods_project.targets.each do |target| | ||
flutter_additional_ios_build_settings(target) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_map/flutter_map.dart'; | ||
import 'package:flutter_map_example/widgets/drawer.dart'; | ||
import 'package:latlong2/latlong.dart'; | ||
|
||
class SecondaryTapPage extends StatelessWidget { | ||
const SecondaryTapPage({super.key}); | ||
|
||
static const route = '/secondary_tap'; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
appBar: AppBar(title: const Text('Secondary Tap')), | ||
drawer: buildDrawer(context, route), | ||
body: Padding( | ||
padding: const EdgeInsets.all(8), | ||
child: Column( | ||
children: [ | ||
const Padding( | ||
padding: EdgeInsets.only(top: 8, bottom: 8), | ||
child: Text('This is a map that supports secondary tap events.'), | ||
), | ||
Flexible( | ||
child: FlutterMap( | ||
options: MapOptions( | ||
onSecondaryTap: (tapPos, latLng) { | ||
ScaffoldMessenger.maybeOf(context)?.showSnackBar( | ||
SnackBar(content: Text('Secondary tap at $latLng')), | ||
); | ||
}, | ||
center: LatLng(51.5, -0.09), | ||
zoom: 5, | ||
), | ||
nonRotatedChildren: [ | ||
AttributionWidget.defaultWidget( | ||
source: 'OpenStreetMap contributors', | ||
onSourceTapped: () {}, | ||
), | ||
], | ||
children: [ | ||
TileLayer( | ||
urlTemplate: | ||
'https://tile.openstreetmap.org/{z}/{x}/{y}.png', | ||
userAgentPackageName: 'dev.fleaflet.flutter_map.example', | ||
), | ||
], | ||
), | ||
), | ||
], | ||
), | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Flutter-related | ||
**/Flutter/ephemeral/ | ||
**/Pods/ | ||
|
||
# Xcode-related | ||
**/dgph | ||
**/xcuserdata/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" | ||
#include "ephemeral/Flutter-Generated.xcconfig" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" | ||
#include "ephemeral/Flutter-Generated.xcconfig" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// | ||
// Generated file. Do not edit. | ||
// | ||
|
||
import FlutterMacOS | ||
import Foundation | ||
|
||
import location | ||
|
||
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { | ||
LocationPlugin.register(with: registry.registrar(forPlugin: "LocationPlugin")) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
platform :osx, '10.11' | ||
|
||
# CocoaPods analytics sends network stats synchronously affecting flutter build latency. | ||
ENV['COCOAPODS_DISABLE_STATS'] = 'true' | ||
|
||
project 'Runner', { | ||
'Debug' => :debug, | ||
'Profile' => :release, | ||
'Release' => :release, | ||
} | ||
|
||
def flutter_root | ||
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__) | ||
unless File.exist?(generated_xcode_build_settings_path) | ||
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first" | ||
end | ||
|
||
File.foreach(generated_xcode_build_settings_path) do |line| | ||
matches = line.match(/FLUTTER_ROOT\=(.*)/) | ||
return matches[1].strip if matches | ||
end | ||
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\"" | ||
end | ||
|
||
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) | ||
|
||
flutter_macos_podfile_setup | ||
|
||
target 'Runner' do | ||
use_frameworks! | ||
use_modular_headers! | ||
|
||
flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) | ||
end | ||
|
||
post_install do |installer| | ||
installer.pods_project.targets.each do |target| | ||
flutter_additional_macos_build_settings(target) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
PODS: | ||
- FlutterMacOS (1.0.0) | ||
- location (0.0.1): | ||
- FlutterMacOS | ||
|
||
DEPENDENCIES: | ||
- FlutterMacOS (from `Flutter/ephemeral`) | ||
- location (from `Flutter/ephemeral/.symlinks/plugins/location/macos`) | ||
|
||
EXTERNAL SOURCES: | ||
FlutterMacOS: | ||
:path: Flutter/ephemeral | ||
location: | ||
:path: Flutter/ephemeral/.symlinks/plugins/location/macos | ||
|
||
SPEC CHECKSUMS: | ||
FlutterMacOS: ae6af50a8ea7d6103d888583d46bd8328a7e9811 | ||
location: 7cdb0665bd6577d382b0a343acdadbcb7f964775 | ||
|
||
PODFILE CHECKSUM: 6eac6b3292e5142cfc23bdeb71848a40ec51c14c | ||
|
||
COCOAPODS: 1.11.3 |
Oops, something went wrong.