mirror of
https://github.com/git-touch/git-touch
synced 2025-03-02 18:27:52 +01:00
feat: launch built-in maps
This commit is contained in:
parent
4fe46b274a
commit
206cd1244c
@ -18,6 +18,7 @@ import 'package:git_touch/widgets/user_header.dart';
|
|||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
import 'package:gql_github/user.data.gql.dart';
|
import 'package:gql_github/user.data.gql.dart';
|
||||||
import 'package:gql_github/user.req.gql.dart';
|
import 'package:gql_github/user.req.gql.dart';
|
||||||
|
import 'package:maps_launcher/maps_launcher.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
class _Repos extends StatelessWidget {
|
class _Repos extends StatelessWidget {
|
||||||
@ -126,8 +127,7 @@ class _User extends StatelessWidget {
|
|||||||
prefix: const Icon(Octicons.location),
|
prefix: const Icon(Octicons.location),
|
||||||
child: Text(p.location!),
|
child: Text(p.location!),
|
||||||
onClick: () {
|
onClick: () {
|
||||||
launchStringUrl(
|
MapsLauncher.launchQuery(p.location!);
|
||||||
'https://www.google.com/maps/place/${p.location!.replaceAll(RegExp(r'\s+'), '')}');
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
if (isNotNullOrEmpty(p.email))
|
if (isNotNullOrEmpty(p.email))
|
||||||
|
@ -6,10 +6,14 @@
|
|||||||
|
|
||||||
#include "generated_plugin_registrant.h"
|
#include "generated_plugin_registrant.h"
|
||||||
|
|
||||||
|
#include <maps_launcher/maps_launcher_plugin.h>
|
||||||
#include <sentry_flutter/sentry_flutter_plugin.h>
|
#include <sentry_flutter/sentry_flutter_plugin.h>
|
||||||
#include <url_launcher_linux/url_launcher_plugin.h>
|
#include <url_launcher_linux/url_launcher_plugin.h>
|
||||||
|
|
||||||
void fl_register_plugins(FlPluginRegistry* registry) {
|
void fl_register_plugins(FlPluginRegistry* registry) {
|
||||||
|
g_autoptr(FlPluginRegistrar) maps_launcher_registrar =
|
||||||
|
fl_plugin_registry_get_registrar_for_plugin(registry, "MapsLauncherPlugin");
|
||||||
|
maps_launcher_plugin_register_with_registrar(maps_launcher_registrar);
|
||||||
g_autoptr(FlPluginRegistrar) sentry_flutter_registrar =
|
g_autoptr(FlPluginRegistrar) sentry_flutter_registrar =
|
||||||
fl_plugin_registry_get_registrar_for_plugin(registry, "SentryFlutterPlugin");
|
fl_plugin_registry_get_registrar_for_plugin(registry, "SentryFlutterPlugin");
|
||||||
sentry_flutter_plugin_register_with_registrar(sentry_flutter_registrar);
|
sentry_flutter_plugin_register_with_registrar(sentry_flutter_registrar);
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
list(APPEND FLUTTER_PLUGIN_LIST
|
list(APPEND FLUTTER_PLUGIN_LIST
|
||||||
|
maps_launcher
|
||||||
sentry_flutter
|
sentry_flutter
|
||||||
url_launcher_linux
|
url_launcher_linux
|
||||||
)
|
)
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
import FlutterMacOS
|
import FlutterMacOS
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
|
import maps_launcher
|
||||||
import package_info_plus_macos
|
import package_info_plus_macos
|
||||||
import path_provider_macos
|
import path_provider_macos
|
||||||
import sentry_flutter
|
import sentry_flutter
|
||||||
@ -13,6 +14,7 @@ import shared_preferences_macos
|
|||||||
import url_launcher_macos
|
import url_launcher_macos
|
||||||
|
|
||||||
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
||||||
|
MapsLauncherPlugin.register(with: registry.registrar(forPlugin: "MapsLauncherPlugin"))
|
||||||
FLTPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlusPlugin"))
|
FLTPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlusPlugin"))
|
||||||
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
|
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
|
||||||
SentryFlutterPlugin.register(with: registry.registrar(forPlugin: "SentryFlutterPlugin"))
|
SentryFlutterPlugin.register(with: registry.registrar(forPlugin: "SentryFlutterPlugin"))
|
||||||
|
@ -511,6 +511,13 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.2"
|
version: "1.0.2"
|
||||||
|
maps_launcher:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: maps_launcher
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.1"
|
||||||
markdown:
|
markdown:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -72,6 +72,7 @@ dependencies:
|
|||||||
google_fonts:
|
google_fonts:
|
||||||
go_router:
|
go_router:
|
||||||
from_css_color:
|
from_css_color:
|
||||||
|
maps_launcher:
|
||||||
antd_mobile:
|
antd_mobile:
|
||||||
path: ../ant-design-mobile-flutter
|
path: ../ant-design-mobile-flutter
|
||||||
|
|
||||||
|
@ -6,10 +6,13 @@
|
|||||||
|
|
||||||
#include "generated_plugin_registrant.h"
|
#include "generated_plugin_registrant.h"
|
||||||
|
|
||||||
|
#include <maps_launcher/maps_launcher_plugin.h>
|
||||||
#include <sentry_flutter/sentry_flutter_plugin.h>
|
#include <sentry_flutter/sentry_flutter_plugin.h>
|
||||||
#include <url_launcher_windows/url_launcher_windows.h>
|
#include <url_launcher_windows/url_launcher_windows.h>
|
||||||
|
|
||||||
void RegisterPlugins(flutter::PluginRegistry* registry) {
|
void RegisterPlugins(flutter::PluginRegistry* registry) {
|
||||||
|
MapsLauncherPluginRegisterWithRegistrar(
|
||||||
|
registry->GetRegistrarForPlugin("MapsLauncherPlugin"));
|
||||||
SentryFlutterPluginRegisterWithRegistrar(
|
SentryFlutterPluginRegisterWithRegistrar(
|
||||||
registry->GetRegistrarForPlugin("SentryFlutterPlugin"));
|
registry->GetRegistrarForPlugin("SentryFlutterPlugin"));
|
||||||
UrlLauncherWindowsRegisterWithRegistrar(
|
UrlLauncherWindowsRegisterWithRegistrar(
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
list(APPEND FLUTTER_PLUGIN_LIST
|
list(APPEND FLUTTER_PLUGIN_LIST
|
||||||
|
maps_launcher
|
||||||
sentry_flutter
|
sentry_flutter
|
||||||
url_launcher_windows
|
url_launcher_windows
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user