diff --git a/.gitignore b/.gitignore
index 92082f19..42ec9e7d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -35,3 +35,4 @@ mason-lock.json
*.flutter-plugins-dependencies
*.flutter-plugins
+*.env
diff --git a/examples/mirai_gallery/android/app/build.gradle b/examples/mirai_gallery/android/app/build.gradle
index 7023f473..3cef43b0 100644
--- a/examples/mirai_gallery/android/app/build.gradle
+++ b/examples/mirai_gallery/android/app/build.gradle
@@ -24,6 +24,7 @@ if (flutterVersionName == null) {
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
+apply from: project(':flutter_config').projectDir.getPath() + "/dotenv.gradle"
android {
compileSdkVersion flutter.compileSdkVersion
diff --git a/examples/mirai_gallery/android/app/src/main/AndroidManifest.xml b/examples/mirai_gallery/android/app/src/main/AndroidManifest.xml
index d5d35f2b..697edbbf 100644
--- a/examples/mirai_gallery/android/app/src/main/AndroidManifest.xml
+++ b/examples/mirai_gallery/android/app/src/main/AndroidManifest.xml
@@ -30,5 +30,11 @@
+
+
+
diff --git a/examples/mirai_gallery/ios/Podfile.lock b/examples/mirai_gallery/ios/Podfile.lock
index 3b52d011..29f735e5 100644
--- a/examples/mirai_gallery/ios/Podfile.lock
+++ b/examples/mirai_gallery/ios/Podfile.lock
@@ -1,22 +1,45 @@
PODS:
- Flutter (1.0.0)
+ - flutter_config (0.0.1):
+ - Flutter
+ - google_maps_flutter_ios (0.0.1):
+ - Flutter
+ - GoogleMaps (< 9.0)
+ - GoogleMaps (6.2.1):
+ - GoogleMaps/Maps (= 6.2.1)
+ - GoogleMaps/Base (6.2.1)
+ - GoogleMaps/Maps (6.2.1):
+ - GoogleMaps/Base
- webview_flutter_wkwebview (0.0.1):
- Flutter
DEPENDENCIES:
- Flutter (from `Flutter`)
+ - flutter_config (from `.symlinks/plugins/flutter_config/ios`)
+ - google_maps_flutter_ios (from `.symlinks/plugins/google_maps_flutter_ios/ios`)
- webview_flutter_wkwebview (from `.symlinks/plugins/webview_flutter_wkwebview/ios`)
+SPEC REPOS:
+ trunk:
+ - GoogleMaps
+
EXTERNAL SOURCES:
Flutter:
:path: Flutter
+ flutter_config:
+ :path: ".symlinks/plugins/flutter_config/ios"
+ google_maps_flutter_ios:
+ :path: ".symlinks/plugins/google_maps_flutter_ios/ios"
webview_flutter_wkwebview:
:path: ".symlinks/plugins/webview_flutter_wkwebview/ios"
SPEC CHECKSUMS:
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
+ flutter_config: f48f0d47a284f1791aacce2687eabb3309ba7a41
+ google_maps_flutter_ios: f135b968a67c05679e0a53538e900b5c174b0d99
+ GoogleMaps: 20d7b12be49a14287f797e88e0e31bc4156aaeb4
webview_flutter_wkwebview: be0f0d33777f1bfd0c9fdcb594786704dbf65f36
PODFILE CHECKSUM: 819463e6a0290f5a72f145ba7cde16e8b6ef0796
-COCOAPODS: 1.15.2
+COCOAPODS: 1.13.0
diff --git a/examples/mirai_gallery/ios/Runner.xcodeproj/project.pbxproj b/examples/mirai_gallery/ios/Runner.xcodeproj/project.pbxproj
index 5a58fb45..205d4824 100644
--- a/examples/mirai_gallery/ios/Runner.xcodeproj/project.pbxproj
+++ b/examples/mirai_gallery/ios/Runner.xcodeproj/project.pbxproj
@@ -198,6 +198,7 @@
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
9182110C26875E7D26526D19 /* [CP] Embed Pods Frameworks */,
+ 5D9698FE94B37C1FBA620C82 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
@@ -285,6 +286,23 @@
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
};
+ 5D9698FE94B37C1FBA620C82 /* [CP] Copy Pods Resources */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputFileListPaths = (
+ "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist",
+ );
+ name = "[CP] Copy Pods Resources";
+ outputFileListPaths = (
+ "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist",
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
+ showEnvVarsInLog = 0;
+ };
83A1AC20750C3F0F0F56EB86 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
diff --git a/examples/mirai_gallery/ios/Runner/AppDelegate.swift b/examples/mirai_gallery/ios/Runner/AppDelegate.swift
index d2a14bfb..6726beb8 100644
--- a/examples/mirai_gallery/ios/Runner/AppDelegate.swift
+++ b/examples/mirai_gallery/ios/Runner/AppDelegate.swift
@@ -1,12 +1,20 @@
import UIKit
import Flutter
+import flutter_config
+import GoogleMaps
+
@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
+
+ //[Google map key]
+ let googleMapKey = FlutterConfigPlugin.env(for: "GOOGLE_MAP_KEY_IOS")
+ GMSServices.provideAPIKey(googleMapKey!)
+
GeneratedPluginRegistrant.register(with: self)
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
diff --git a/examples/mirai_gallery/lib/app/google_map/google_map_screen.dart b/examples/mirai_gallery/lib/app/google_map/google_map_screen.dart
new file mode 100644
index 00000000..1c8e201c
--- /dev/null
+++ b/examples/mirai_gallery/lib/app/google_map/google_map_screen.dart
@@ -0,0 +1,49 @@
+import 'dart:developer';
+
+import 'package:flutter/material.dart';
+import 'package:mirai/mirai.dart';
+
+class GoogleMapScreen extends StatelessWidget {
+ const GoogleMapScreen({super.key});
+
+ @override
+ Widget build(BuildContext context) {
+ // log("data ${data.toJson()}");
+
+
+
+ return Mirai.fromJson({
+ "type": "scaffold",
+ "appBar": {
+ "type": "appBar",
+ "title": {
+ "type": "text",
+ "data": "Google Map Example",
+ }
+ },
+ "body": {
+ "type": "googleMap",
+ "initialCameraPosition": {
+ "target": {
+ "latitude": 37.42796133580664,
+ "longitude": -122.085749655962,
+ },
+ "zoom": 14.4746,
+ "tilt": 10,
+ },
+ "compassEnabled": true,
+ "mapToolbarEnabled": true,
+ "indoorViewEnabled": true,
+ "trafficEnabled": true,
+ "buildingsEnabled": true,
+ "myLocationButtonEnabled": true,
+ "padding": {
+ "left": 50,
+ "right": 10,
+ "bottom": 20,
+ }
+ }
+ }, context) ??
+ const SizedBox();
+ }
+}
diff --git a/examples/mirai_gallery/lib/main.dart b/examples/mirai_gallery/lib/main.dart
index c046f758..0e21c894 100644
--- a/examples/mirai_gallery/lib/main.dart
+++ b/examples/mirai_gallery/lib/main.dart
@@ -2,6 +2,7 @@ import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:flutter_config/flutter_config.dart';
import 'package:mirai/mirai.dart';
import 'package:mirai_gallery/app/details/details_screen.dart';
import 'package:mirai_gallery/app/example/example_screen_parser.dart';
@@ -9,16 +10,20 @@ import 'package:mirai_gallery/app/home/home_screen.dart';
import 'package:mirai_gallery/app_theme/app_theme_cubit.dart';
import 'package:mirai_webview/mirai_webview.dart';
+import 'app/google_map/google_map_screen.dart';
+
class MyHttpOverrides extends HttpOverrides {
@override
HttpClient createHttpClient(SecurityContext? context) {
return super.createHttpClient(context)
- ..badCertificateCallback =
- (X509Certificate cert, String host, int port) => true;
+ ..badCertificateCallback = (X509Certificate cert, String host, int port) => true;
}
}
void main() async {
+ WidgetsFlutterBinding.ensureInitialized(); // Required by FlutterConfig
+ await FlutterConfig.loadEnvVariables();
+
HttpOverrides.global = MyHttpOverrides();
await Mirai.initialize(
parsers: const [
@@ -43,10 +48,12 @@ class MyApp extends StatelessWidget {
theme: state.lightTheme,
darkTheme: state.darkTheme,
themeMode: state.themeMode,
- homeBuilder: (context) => const HomeScreen(),
+ // homeBuilder: (context) => const HomeScreen(),
+ homeBuilder: (context) => const GoogleMapScreen(),
title: 'Mirai Gallery',
routes: {
- '/homeScreen': (context) => const HomeScreen(),
+ // '/homeScreen': (context) => const HomeScreen(),
+ '/homeScreen': (context) => const GoogleMapScreen(),
'/detailsScreen': (context) => const DetailsScreen(),
},
);
diff --git a/examples/mirai_gallery/pubspec.lock b/examples/mirai_gallery/pubspec.lock
index d1e81e2c..49e9d97a 100644
--- a/examples/mirai_gallery/pubspec.lock
+++ b/examples/mirai_gallery/pubspec.lock
@@ -169,6 +169,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.0.3"
+ csslib:
+ dependency: transitive
+ description:
+ name: csslib
+ sha256: "706b5707578e0c1b4b7550f64078f0a0f19dec3f50a178ffae7006b0a9ca58fb"
+ url: "https://pub.dev"
+ source: hosted
+ version: "1.0.0"
cupertino_icons:
dependency: "direct main"
description:
@@ -230,6 +238,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "8.1.3"
+ flutter_config:
+ dependency: "direct main"
+ description:
+ name: flutter_config
+ sha256: a07e6156bb6e776e29c6357be433155acda87d1dab1a3f787a72091a1b71ffbf
+ url: "https://pub.dev"
+ source: hosted
+ version: "2.0.2"
flutter_lints:
dependency: "direct dev"
description:
@@ -238,11 +254,24 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.0.1"
+ flutter_plugin_android_lifecycle:
+ dependency: transitive
+ description:
+ name: flutter_plugin_android_lifecycle
+ sha256: b068ffc46f82a55844acfa4fdbb61fad72fa2aef0905548419d97f0f95c456da
+ url: "https://pub.dev"
+ source: hosted
+ version: "2.0.17"
flutter_test:
dependency: "direct dev"
description: flutter
source: sdk
version: "0.0.0"
+ flutter_web_plugins:
+ dependency: transitive
+ description: flutter
+ source: sdk
+ version: "0.0.0"
freezed:
dependency: "direct dev"
description:
@@ -275,6 +304,54 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.2"
+ google_maps:
+ dependency: transitive
+ description:
+ name: google_maps
+ sha256: "47eef3836b49bb030d5cb3afc60b8451408bf34cf753e571b645d6529eb4251a"
+ url: "https://pub.dev"
+ source: hosted
+ version: "7.1.0"
+ google_maps_flutter:
+ dependency: transitive
+ description:
+ name: google_maps_flutter
+ sha256: "982c2e22ec78d32701bfbd351311e8579a4952035381ac66462c0af11003107b"
+ url: "https://pub.dev"
+ source: hosted
+ version: "2.6.0"
+ google_maps_flutter_android:
+ dependency: transitive
+ description:
+ name: google_maps_flutter_android
+ sha256: "256b3c974e415bd17555ceff76a5d0badd2cbfd29febfc23070993358f639550"
+ url: "https://pub.dev"
+ source: hosted
+ version: "2.7.0"
+ google_maps_flutter_ios:
+ dependency: transitive
+ description:
+ name: google_maps_flutter_ios
+ sha256: "0997f99d8bd8712f648a49bfc96a3cf2713cfdaf73a005c719aab74eaef94030"
+ url: "https://pub.dev"
+ source: hosted
+ version: "2.5.0"
+ google_maps_flutter_platform_interface:
+ dependency: transitive
+ description:
+ name: google_maps_flutter_platform_interface
+ sha256: "167af879da4d004cd58771f1469b91dcc3b9b0a2c5334cc6bf71fd41d4b35403"
+ url: "https://pub.dev"
+ source: hosted
+ version: "2.6.0"
+ google_maps_flutter_web:
+ dependency: transitive
+ description:
+ name: google_maps_flutter_web
+ sha256: "861c6dd430123e58bb1154342345c5bfa36064120c8ec3dbc0d0b7522add1861"
+ url: "https://pub.dev"
+ source: hosted
+ version: "0.5.6+2"
graphs:
dependency: transitive
description:
@@ -283,6 +360,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.3.1"
+ html:
+ dependency: transitive
+ description:
+ name: html
+ sha256: "3a7812d5bcd2894edf53dfaf8cd640876cf6cef50a8f238745c8b8120ea74d3a"
+ url: "https://pub.dev"
+ source: hosted
+ version: "0.15.4"
http_multi_server:
dependency: transitive
description:
@@ -311,10 +396,18 @@ packages:
dependency: transitive
description:
name: js
- sha256: "4186c61b32f99e60f011f7160e32c89a758ae9b1d0c6d28e2c02ef0382300e2b"
+ sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3
url: "https://pub.dev"
source: hosted
- version: "0.7.0"
+ version: "0.6.7"
+ js_wrapping:
+ dependency: transitive
+ description:
+ name: js_wrapping
+ sha256: e385980f7c76a8c1c9a560dfb623b890975841542471eade630b2871d243851c
+ url: "https://pub.dev"
+ source: hosted
+ version: "0.7.4"
json_annotation:
dependency: "direct main"
description:
@@ -417,7 +510,7 @@ packages:
path: "../../packages/mirai"
relative: true
source: path
- version: "0.6.0"
+ version: "0.7.0"
mirai_framework:
dependency: "direct overridden"
description:
@@ -496,6 +589,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.2.3"
+ sanitize_html:
+ dependency: transitive
+ description:
+ name: sanitize_html
+ sha256: "12669c4a913688a26555323fb9cec373d8f9fbe091f2d01c40c723b33caa8989"
+ url: "https://pub.dev"
+ source: hosted
+ version: "2.1.0"
shelf:
dependency: transitive
description:
@@ -629,6 +730,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.1.0"
+ web:
+ dependency: transitive
+ description:
+ name: web
+ sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27"
+ url: "https://pub.dev"
+ source: hosted
+ version: "0.5.1"
web_socket_channel:
dependency: transitive
description:
@@ -678,5 +787,5 @@ packages:
source: hosted
version: "3.1.2"
sdks:
- dart: ">=3.2.3 <4.0.0"
- flutter: ">=3.16.6"
+ dart: ">=3.3.0 <4.0.0"
+ flutter: ">=3.19.0"
diff --git a/examples/mirai_gallery/pubspec.yaml b/examples/mirai_gallery/pubspec.yaml
index 5ea520bb..b6987169 100644
--- a/examples/mirai_gallery/pubspec.yaml
+++ b/examples/mirai_gallery/pubspec.yaml
@@ -39,6 +39,7 @@ dependencies:
flutter_bloc: ^8.1.3
mirai: ^0.5.1
mirai_webview: ^0.0.2
+ flutter_config: ^2.0.2
dev_dependencies:
flutter_test:
diff --git a/packages/mirai/lib/src/framework/mirai.dart b/packages/mirai/lib/src/framework/mirai.dart
index cb8b3bfe..cb8d145a 100644
--- a/packages/mirai/lib/src/framework/mirai.dart
+++ b/packages/mirai/lib/src/framework/mirai.dart
@@ -69,6 +69,7 @@ class Mirai {
const MiraiBottomNavigationViewParser(),
const MiraiDefaultBottomNavigationControllerParser(),
const MiraiWrapParser(),
+ const MiraiGoogleMapParser(),
];
static final _actionParsers = [
@@ -118,8 +119,7 @@ class Mirai {
try {
if (json != null && json['actionType'] != null) {
String actionType = json['actionType'];
- MiraiActionParser? miraiActionParser =
- MiraiRegistry.instance.getActionParser(actionType);
+ MiraiActionParser? miraiActionParser = MiraiRegistry.instance.getActionParser(actionType);
if (miraiActionParser != null) {
final model = miraiActionParser.getModel(json);
return miraiActionParser.onCall(context, model);
diff --git a/packages/mirai/lib/src/parsers/mirai_container/mirai_container_parser.dart b/packages/mirai/lib/src/parsers/mirai_container/mirai_container_parser.dart
index 506c2be1..0cc76ff8 100644
--- a/packages/mirai/lib/src/parsers/mirai_container/mirai_container_parser.dart
+++ b/packages/mirai/lib/src/parsers/mirai_container/mirai_container_parser.dart
@@ -1,3 +1,4 @@
+
import 'package:flutter/cupertino.dart';
import 'package:mirai/mirai.dart';
import 'package:mirai/src/parsers/mirai_box_constraints/mirai_box_constraints.dart';
@@ -10,8 +11,7 @@ class MiraiContainerParser extends MiraiParser {
String get type => WidgetType.container.name;
@override
- MiraiContainer getModel(Map json) =>
- MiraiContainer.fromJson(json);
+ MiraiContainer getModel(Map json) => MiraiContainer.fromJson(json);
@override
Widget parse(BuildContext context, MiraiContainer model) {
diff --git a/packages/mirai/lib/src/parsers/mirai_edge_insets/mirai_edge_insets.dart b/packages/mirai/lib/src/parsers/mirai_edge_insets/mirai_edge_insets.dart
index 87a678b6..bbe27742 100644
--- a/packages/mirai/lib/src/parsers/mirai_edge_insets/mirai_edge_insets.dart
+++ b/packages/mirai/lib/src/parsers/mirai_edge_insets/mirai_edge_insets.dart
@@ -19,23 +19,13 @@ class MiraiEdgeInsets with _$MiraiEdgeInsets {
Map resultantJson;
if (json is num) {
- resultantJson = {
- "left": json,
- "top": json,
- "right": json,
- "bottom": json
- };
+ resultantJson = {"left": json, "top": json, "right": json, "bottom": json};
} else if (json is List && json.length == 4) {
bool allElementsNum = json.every((element) => element is num);
if (!allElementsNum) {
throw ArgumentError('Invalid input format for MiraiEdgeInsets');
}
- resultantJson = {
- "left": json[0],
- "top": json[1],
- "right": json[2],
- "bottom": json[3]
- };
+ resultantJson = {"left": json[0], "top": json[1], "right": json[2], "bottom": json[3]};
} else if (json is Map) {
resultantJson = json;
} else {
@@ -44,6 +34,8 @@ class MiraiEdgeInsets with _$MiraiEdgeInsets {
return _$MiraiEdgeInsetsFromJson(resultantJson);
}
+
+ static const MiraiEdgeInsets zero = MiraiEdgeInsets(bottom: 0, left: 0, right: 0, top: 0);
}
extension MiraiEdgeInsetsParser on MiraiEdgeInsets? {
diff --git a/packages/mirai/lib/src/parsers/mirai_google_map/mirai_google_map.dart b/packages/mirai/lib/src/parsers/mirai_google_map/mirai_google_map.dart
new file mode 100644
index 00000000..a6b36ec1
--- /dev/null
+++ b/packages/mirai/lib/src/parsers/mirai_google_map/mirai_google_map.dart
@@ -0,0 +1,73 @@
+import 'package:flutter/foundation.dart';
+import 'package:flutter/gestures.dart';
+import 'package:flutter/material.dart';
+import 'package:freezed_annotation/freezed_annotation.dart';
+import 'package:mirai/src/parsers/mirai_edge_insets/mirai_edge_insets.dart';
+import 'mirai_google_map_types/mirai_google_map_camera.dart';
+import 'mirai_google_map_types/mirai_google_map_circle.dart';
+import 'mirai_google_map_types/mirai_google_map_marker.dart';
+import 'mirai_google_map_types/mirai_google_map_polygon.dart';
+import 'mirai_google_map_types/mirai_google_map_polyline.dart';
+import 'mirai_google_map_types/mirai_google_map_tile_overlay.dart';
+import 'mirai_google_map_types/mirai_google_map_ui.dart';
+import 'mirai_google_map_types/mirai_google_map_web_gesture_handling.dart';
+
+export 'package:mirai/src/parsers/mirai_google_map/mirai_google_map_parser.dart';
+
+export 'mirai_google_map_types/mirai_google_map_camera.dart';
+export 'mirai_google_map_types/mirai_google_map_circle.dart';
+export 'mirai_google_map_types/mirai_google_map_marker.dart';
+export 'mirai_google_map_types/mirai_google_map_polygon.dart';
+export 'mirai_google_map_types/mirai_google_map_polyline.dart';
+export 'mirai_google_map_types/mirai_google_map_tile_overlay.dart';
+export 'mirai_google_map_types/mirai_google_map_ui.dart';
+export 'mirai_google_map_types/mirai_google_map_web_gesture_handling.dart';
+
+part 'mirai_google_map.freezed.dart';
+part 'mirai_google_map.g.dart';
+
+@freezed
+class MiraiGoogleMap with _$MiraiGoogleMap {
+ const factory MiraiGoogleMap({
+ // super.key,
+ required MiraiCameraPosition initialCameraPosition,
+ String? style,
+ // required Set> gestureRecognizers,
+ MiraiWebGestureHandling? webGestureHandling,
+ @Default(true) bool compassEnabled,
+ @Default(true) bool mapToolbarEnabled,
+ MiraiCameraTargetBounds? cameraTargetBounds,
+ @Default(MiraiGoogleMapType.normal) MiraiGoogleMapType mapType,
+ MiraiMinMaxZoomPreference? minMaxZoomPreference,
+ @Default(true) bool rotateGesturesEnabled,
+ @Default(true) bool scrollGesturesEnabled,
+ @Default(true) bool zoomControlsEnabled,
+ @Default(true) bool zoomGesturesEnabled,
+ @Default(false) bool liteModeEnabled,
+ @Default(true) bool tiltGesturesEnabled,
+ @Default(false) bool fortyFiveDegreeImageryEnabled,
+ @Default(true) bool myLocationEnabled,
+ required bool myLocationButtonEnabled,
+ String? layoutDirection,
+
+ /// If no padding is specified default padding will be 0.
+ @Default(MiraiEdgeInsets.zero) MiraiEdgeInsets padding,
+ required bool indoorViewEnabled,
+ required bool trafficEnabled,
+ required bool buildingsEnabled,
+ @Default({}) Set markers,
+ @Default({}) Set circles,
+ @Default({}) Set polygons,
+ @Default({}) Set polylines,
+ @Default({}) Set tileOverlays,
+ Map? onCameraMoveStarted,
+ Map? onCameraMove,
+ Map? onCameraIdle,
+ Map? onTap,
+ Map? onLongPress,
+ Map? onMapCreated,
+ String? cloudMapId,
+ }) = _MiraiGoogleMap;
+
+ factory MiraiGoogleMap.fromJson(Map json) => _$MiraiGoogleMapFromJson(json);
+}
diff --git a/packages/mirai/lib/src/parsers/mirai_google_map/mirai_google_map.freezed.dart b/packages/mirai/lib/src/parsers/mirai_google_map/mirai_google_map.freezed.dart
new file mode 100644
index 00000000..a82fec58
--- /dev/null
+++ b/packages/mirai/lib/src/parsers/mirai_google_map/mirai_google_map.freezed.dart
@@ -0,0 +1,1106 @@
+// coverage:ignore-file
+// GENERATED CODE - DO NOT MODIFY BY HAND
+// ignore_for_file: type=lint
+// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
+
+part of 'mirai_google_map.dart';
+
+// **************************************************************************
+// FreezedGenerator
+// **************************************************************************
+
+T _$identity(T value) => value;
+
+final _privateConstructorUsedError = UnsupportedError(
+ 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
+
+MiraiGoogleMap _$MiraiGoogleMapFromJson(Map json) {
+ return _MiraiGoogleMap.fromJson(json);
+}
+
+/// @nodoc
+mixin _$MiraiGoogleMap {
+// super.key,
+ MiraiCameraPosition get initialCameraPosition =>
+ throw _privateConstructorUsedError;
+ String? get style =>
+ throw _privateConstructorUsedError; // required Set> gestureRecognizers,
+ MiraiWebGestureHandling? get webGestureHandling =>
+ throw _privateConstructorUsedError;
+ bool get compassEnabled => throw _privateConstructorUsedError;
+ bool get mapToolbarEnabled => throw _privateConstructorUsedError;
+ MiraiCameraTargetBounds? get cameraTargetBounds =>
+ throw _privateConstructorUsedError;
+ MiraiGoogleMapType get mapType => throw _privateConstructorUsedError;
+ MiraiMinMaxZoomPreference? get minMaxZoomPreference =>
+ throw _privateConstructorUsedError;
+ bool get rotateGesturesEnabled => throw _privateConstructorUsedError;
+ bool get scrollGesturesEnabled => throw _privateConstructorUsedError;
+ bool get zoomControlsEnabled => throw _privateConstructorUsedError;
+ bool get zoomGesturesEnabled => throw _privateConstructorUsedError;
+ bool get liteModeEnabled => throw _privateConstructorUsedError;
+ bool get tiltGesturesEnabled => throw _privateConstructorUsedError;
+ bool get fortyFiveDegreeImageryEnabled => throw _privateConstructorUsedError;
+ bool get myLocationEnabled => throw _privateConstructorUsedError;
+ bool get myLocationButtonEnabled => throw _privateConstructorUsedError;
+ String? get layoutDirection => throw _privateConstructorUsedError;
+
+ /// If no padding is specified default padding will be 0.
+ MiraiEdgeInsets get padding => throw _privateConstructorUsedError;
+ bool get indoorViewEnabled => throw _privateConstructorUsedError;
+ bool get trafficEnabled => throw _privateConstructorUsedError;
+ bool get buildingsEnabled => throw _privateConstructorUsedError;
+ Set get markers => throw _privateConstructorUsedError;
+ Set get circles => throw _privateConstructorUsedError;
+ Set get polygons => throw _privateConstructorUsedError;
+ Set get polylines => throw _privateConstructorUsedError;
+ Set get tileOverlays => throw _privateConstructorUsedError;
+ Map? get onCameraMoveStarted =>
+ throw _privateConstructorUsedError;
+ Map? get onCameraMove => throw _privateConstructorUsedError;
+ Map? get onCameraIdle => throw _privateConstructorUsedError;
+ Map? get onTap => throw _privateConstructorUsedError;
+ Map? get onLongPress => throw _privateConstructorUsedError;
+ Map? get onMapCreated => throw _privateConstructorUsedError;
+ String? get cloudMapId => throw _privateConstructorUsedError;
+
+ Map toJson() => throw _privateConstructorUsedError;
+ @JsonKey(ignore: true)
+ $MiraiGoogleMapCopyWith get copyWith =>
+ throw _privateConstructorUsedError;
+}
+
+/// @nodoc
+abstract class $MiraiGoogleMapCopyWith<$Res> {
+ factory $MiraiGoogleMapCopyWith(
+ MiraiGoogleMap value, $Res Function(MiraiGoogleMap) then) =
+ _$MiraiGoogleMapCopyWithImpl<$Res, MiraiGoogleMap>;
+ @useResult
+ $Res call(
+ {MiraiCameraPosition initialCameraPosition,
+ String? style,
+ MiraiWebGestureHandling? webGestureHandling,
+ bool compassEnabled,
+ bool mapToolbarEnabled,
+ MiraiCameraTargetBounds? cameraTargetBounds,
+ MiraiGoogleMapType mapType,
+ MiraiMinMaxZoomPreference? minMaxZoomPreference,
+ bool rotateGesturesEnabled,
+ bool scrollGesturesEnabled,
+ bool zoomControlsEnabled,
+ bool zoomGesturesEnabled,
+ bool liteModeEnabled,
+ bool tiltGesturesEnabled,
+ bool fortyFiveDegreeImageryEnabled,
+ bool myLocationEnabled,
+ bool myLocationButtonEnabled,
+ String? layoutDirection,
+ MiraiEdgeInsets padding,
+ bool indoorViewEnabled,
+ bool trafficEnabled,
+ bool buildingsEnabled,
+ Set markers,
+ Set circles,
+ Set polygons,
+ Set polylines,
+ Set tileOverlays,
+ Map? onCameraMoveStarted,
+ Map? onCameraMove,
+ Map? onCameraIdle,
+ Map? onTap,
+ Map? onLongPress,
+ Map? onMapCreated,
+ String? cloudMapId});
+
+ $MiraiCameraPositionCopyWith<$Res> get initialCameraPosition;
+ $MiraiCameraTargetBoundsCopyWith<$Res>? get cameraTargetBounds;
+ $MiraiMinMaxZoomPreferenceCopyWith<$Res>? get minMaxZoomPreference;
+ $MiraiEdgeInsetsCopyWith<$Res> get padding;
+}
+
+/// @nodoc
+class _$MiraiGoogleMapCopyWithImpl<$Res, $Val extends MiraiGoogleMap>
+ implements $MiraiGoogleMapCopyWith<$Res> {
+ _$MiraiGoogleMapCopyWithImpl(this._value, this._then);
+
+ // ignore: unused_field
+ final $Val _value;
+ // ignore: unused_field
+ final $Res Function($Val) _then;
+
+ @pragma('vm:prefer-inline')
+ @override
+ $Res call({
+ Object? initialCameraPosition = null,
+ Object? style = freezed,
+ Object? webGestureHandling = freezed,
+ Object? compassEnabled = null,
+ Object? mapToolbarEnabled = null,
+ Object? cameraTargetBounds = freezed,
+ Object? mapType = null,
+ Object? minMaxZoomPreference = freezed,
+ Object? rotateGesturesEnabled = null,
+ Object? scrollGesturesEnabled = null,
+ Object? zoomControlsEnabled = null,
+ Object? zoomGesturesEnabled = null,
+ Object? liteModeEnabled = null,
+ Object? tiltGesturesEnabled = null,
+ Object? fortyFiveDegreeImageryEnabled = null,
+ Object? myLocationEnabled = null,
+ Object? myLocationButtonEnabled = null,
+ Object? layoutDirection = freezed,
+ Object? padding = null,
+ Object? indoorViewEnabled = null,
+ Object? trafficEnabled = null,
+ Object? buildingsEnabled = null,
+ Object? markers = null,
+ Object? circles = null,
+ Object? polygons = null,
+ Object? polylines = null,
+ Object? tileOverlays = null,
+ Object? onCameraMoveStarted = freezed,
+ Object? onCameraMove = freezed,
+ Object? onCameraIdle = freezed,
+ Object? onTap = freezed,
+ Object? onLongPress = freezed,
+ Object? onMapCreated = freezed,
+ Object? cloudMapId = freezed,
+ }) {
+ return _then(_value.copyWith(
+ initialCameraPosition: null == initialCameraPosition
+ ? _value.initialCameraPosition
+ : initialCameraPosition // ignore: cast_nullable_to_non_nullable
+ as MiraiCameraPosition,
+ style: freezed == style
+ ? _value.style
+ : style // ignore: cast_nullable_to_non_nullable
+ as String?,
+ webGestureHandling: freezed == webGestureHandling
+ ? _value.webGestureHandling
+ : webGestureHandling // ignore: cast_nullable_to_non_nullable
+ as MiraiWebGestureHandling?,
+ compassEnabled: null == compassEnabled
+ ? _value.compassEnabled
+ : compassEnabled // ignore: cast_nullable_to_non_nullable
+ as bool,
+ mapToolbarEnabled: null == mapToolbarEnabled
+ ? _value.mapToolbarEnabled
+ : mapToolbarEnabled // ignore: cast_nullable_to_non_nullable
+ as bool,
+ cameraTargetBounds: freezed == cameraTargetBounds
+ ? _value.cameraTargetBounds
+ : cameraTargetBounds // ignore: cast_nullable_to_non_nullable
+ as MiraiCameraTargetBounds?,
+ mapType: null == mapType
+ ? _value.mapType
+ : mapType // ignore: cast_nullable_to_non_nullable
+ as MiraiGoogleMapType,
+ minMaxZoomPreference: freezed == minMaxZoomPreference
+ ? _value.minMaxZoomPreference
+ : minMaxZoomPreference // ignore: cast_nullable_to_non_nullable
+ as MiraiMinMaxZoomPreference?,
+ rotateGesturesEnabled: null == rotateGesturesEnabled
+ ? _value.rotateGesturesEnabled
+ : rotateGesturesEnabled // ignore: cast_nullable_to_non_nullable
+ as bool,
+ scrollGesturesEnabled: null == scrollGesturesEnabled
+ ? _value.scrollGesturesEnabled
+ : scrollGesturesEnabled // ignore: cast_nullable_to_non_nullable
+ as bool,
+ zoomControlsEnabled: null == zoomControlsEnabled
+ ? _value.zoomControlsEnabled
+ : zoomControlsEnabled // ignore: cast_nullable_to_non_nullable
+ as bool,
+ zoomGesturesEnabled: null == zoomGesturesEnabled
+ ? _value.zoomGesturesEnabled
+ : zoomGesturesEnabled // ignore: cast_nullable_to_non_nullable
+ as bool,
+ liteModeEnabled: null == liteModeEnabled
+ ? _value.liteModeEnabled
+ : liteModeEnabled // ignore: cast_nullable_to_non_nullable
+ as bool,
+ tiltGesturesEnabled: null == tiltGesturesEnabled
+ ? _value.tiltGesturesEnabled
+ : tiltGesturesEnabled // ignore: cast_nullable_to_non_nullable
+ as bool,
+ fortyFiveDegreeImageryEnabled: null == fortyFiveDegreeImageryEnabled
+ ? _value.fortyFiveDegreeImageryEnabled
+ : fortyFiveDegreeImageryEnabled // ignore: cast_nullable_to_non_nullable
+ as bool,
+ myLocationEnabled: null == myLocationEnabled
+ ? _value.myLocationEnabled
+ : myLocationEnabled // ignore: cast_nullable_to_non_nullable
+ as bool,
+ myLocationButtonEnabled: null == myLocationButtonEnabled
+ ? _value.myLocationButtonEnabled
+ : myLocationButtonEnabled // ignore: cast_nullable_to_non_nullable
+ as bool,
+ layoutDirection: freezed == layoutDirection
+ ? _value.layoutDirection
+ : layoutDirection // ignore: cast_nullable_to_non_nullable
+ as String?,
+ padding: null == padding
+ ? _value.padding
+ : padding // ignore: cast_nullable_to_non_nullable
+ as MiraiEdgeInsets,
+ indoorViewEnabled: null == indoorViewEnabled
+ ? _value.indoorViewEnabled
+ : indoorViewEnabled // ignore: cast_nullable_to_non_nullable
+ as bool,
+ trafficEnabled: null == trafficEnabled
+ ? _value.trafficEnabled
+ : trafficEnabled // ignore: cast_nullable_to_non_nullable
+ as bool,
+ buildingsEnabled: null == buildingsEnabled
+ ? _value.buildingsEnabled
+ : buildingsEnabled // ignore: cast_nullable_to_non_nullable
+ as bool,
+ markers: null == markers
+ ? _value.markers
+ : markers // ignore: cast_nullable_to_non_nullable
+ as Set,
+ circles: null == circles
+ ? _value.circles
+ : circles // ignore: cast_nullable_to_non_nullable
+ as Set,
+ polygons: null == polygons
+ ? _value.polygons
+ : polygons // ignore: cast_nullable_to_non_nullable
+ as Set,
+ polylines: null == polylines
+ ? _value.polylines
+ : polylines // ignore: cast_nullable_to_non_nullable
+ as Set,
+ tileOverlays: null == tileOverlays
+ ? _value.tileOverlays
+ : tileOverlays // ignore: cast_nullable_to_non_nullable
+ as Set,
+ onCameraMoveStarted: freezed == onCameraMoveStarted
+ ? _value.onCameraMoveStarted
+ : onCameraMoveStarted // ignore: cast_nullable_to_non_nullable
+ as Map?,
+ onCameraMove: freezed == onCameraMove
+ ? _value.onCameraMove
+ : onCameraMove // ignore: cast_nullable_to_non_nullable
+ as Map?,
+ onCameraIdle: freezed == onCameraIdle
+ ? _value.onCameraIdle
+ : onCameraIdle // ignore: cast_nullable_to_non_nullable
+ as Map?,
+ onTap: freezed == onTap
+ ? _value.onTap
+ : onTap // ignore: cast_nullable_to_non_nullable
+ as Map?,
+ onLongPress: freezed == onLongPress
+ ? _value.onLongPress
+ : onLongPress // ignore: cast_nullable_to_non_nullable
+ as Map?,
+ onMapCreated: freezed == onMapCreated
+ ? _value.onMapCreated
+ : onMapCreated // ignore: cast_nullable_to_non_nullable
+ as Map?,
+ cloudMapId: freezed == cloudMapId
+ ? _value.cloudMapId
+ : cloudMapId // ignore: cast_nullable_to_non_nullable
+ as String?,
+ ) as $Val);
+ }
+
+ @override
+ @pragma('vm:prefer-inline')
+ $MiraiCameraPositionCopyWith<$Res> get initialCameraPosition {
+ return $MiraiCameraPositionCopyWith<$Res>(_value.initialCameraPosition,
+ (value) {
+ return _then(_value.copyWith(initialCameraPosition: value) as $Val);
+ });
+ }
+
+ @override
+ @pragma('vm:prefer-inline')
+ $MiraiCameraTargetBoundsCopyWith<$Res>? get cameraTargetBounds {
+ if (_value.cameraTargetBounds == null) {
+ return null;
+ }
+
+ return $MiraiCameraTargetBoundsCopyWith<$Res>(_value.cameraTargetBounds!,
+ (value) {
+ return _then(_value.copyWith(cameraTargetBounds: value) as $Val);
+ });
+ }
+
+ @override
+ @pragma('vm:prefer-inline')
+ $MiraiMinMaxZoomPreferenceCopyWith<$Res>? get minMaxZoomPreference {
+ if (_value.minMaxZoomPreference == null) {
+ return null;
+ }
+
+ return $MiraiMinMaxZoomPreferenceCopyWith<$Res>(
+ _value.minMaxZoomPreference!, (value) {
+ return _then(_value.copyWith(minMaxZoomPreference: value) as $Val);
+ });
+ }
+
+ @override
+ @pragma('vm:prefer-inline')
+ $MiraiEdgeInsetsCopyWith<$Res> get padding {
+ return $MiraiEdgeInsetsCopyWith<$Res>(_value.padding, (value) {
+ return _then(_value.copyWith(padding: value) as $Val);
+ });
+ }
+}
+
+/// @nodoc
+abstract class _$$MiraiGoogleMapImplCopyWith<$Res>
+ implements $MiraiGoogleMapCopyWith<$Res> {
+ factory _$$MiraiGoogleMapImplCopyWith(_$MiraiGoogleMapImpl value,
+ $Res Function(_$MiraiGoogleMapImpl) then) =
+ __$$MiraiGoogleMapImplCopyWithImpl<$Res>;
+ @override
+ @useResult
+ $Res call(
+ {MiraiCameraPosition initialCameraPosition,
+ String? style,
+ MiraiWebGestureHandling? webGestureHandling,
+ bool compassEnabled,
+ bool mapToolbarEnabled,
+ MiraiCameraTargetBounds? cameraTargetBounds,
+ MiraiGoogleMapType mapType,
+ MiraiMinMaxZoomPreference? minMaxZoomPreference,
+ bool rotateGesturesEnabled,
+ bool scrollGesturesEnabled,
+ bool zoomControlsEnabled,
+ bool zoomGesturesEnabled,
+ bool liteModeEnabled,
+ bool tiltGesturesEnabled,
+ bool fortyFiveDegreeImageryEnabled,
+ bool myLocationEnabled,
+ bool myLocationButtonEnabled,
+ String? layoutDirection,
+ MiraiEdgeInsets padding,
+ bool indoorViewEnabled,
+ bool trafficEnabled,
+ bool buildingsEnabled,
+ Set markers,
+ Set circles,
+ Set polygons,
+ Set polylines,
+ Set tileOverlays,
+ Map? onCameraMoveStarted,
+ Map? onCameraMove,
+ Map? onCameraIdle,
+ Map? onTap,
+ Map? onLongPress,
+ Map? onMapCreated,
+ String? cloudMapId});
+
+ @override
+ $MiraiCameraPositionCopyWith<$Res> get initialCameraPosition;
+ @override
+ $MiraiCameraTargetBoundsCopyWith<$Res>? get cameraTargetBounds;
+ @override
+ $MiraiMinMaxZoomPreferenceCopyWith<$Res>? get minMaxZoomPreference;
+ @override
+ $MiraiEdgeInsetsCopyWith<$Res> get padding;
+}
+
+/// @nodoc
+class __$$MiraiGoogleMapImplCopyWithImpl<$Res>
+ extends _$MiraiGoogleMapCopyWithImpl<$Res, _$MiraiGoogleMapImpl>
+ implements _$$MiraiGoogleMapImplCopyWith<$Res> {
+ __$$MiraiGoogleMapImplCopyWithImpl(
+ _$MiraiGoogleMapImpl _value, $Res Function(_$MiraiGoogleMapImpl) _then)
+ : super(_value, _then);
+
+ @pragma('vm:prefer-inline')
+ @override
+ $Res call({
+ Object? initialCameraPosition = null,
+ Object? style = freezed,
+ Object? webGestureHandling = freezed,
+ Object? compassEnabled = null,
+ Object? mapToolbarEnabled = null,
+ Object? cameraTargetBounds = freezed,
+ Object? mapType = null,
+ Object? minMaxZoomPreference = freezed,
+ Object? rotateGesturesEnabled = null,
+ Object? scrollGesturesEnabled = null,
+ Object? zoomControlsEnabled = null,
+ Object? zoomGesturesEnabled = null,
+ Object? liteModeEnabled = null,
+ Object? tiltGesturesEnabled = null,
+ Object? fortyFiveDegreeImageryEnabled = null,
+ Object? myLocationEnabled = null,
+ Object? myLocationButtonEnabled = null,
+ Object? layoutDirection = freezed,
+ Object? padding = null,
+ Object? indoorViewEnabled = null,
+ Object? trafficEnabled = null,
+ Object? buildingsEnabled = null,
+ Object? markers = null,
+ Object? circles = null,
+ Object? polygons = null,
+ Object? polylines = null,
+ Object? tileOverlays = null,
+ Object? onCameraMoveStarted = freezed,
+ Object? onCameraMove = freezed,
+ Object? onCameraIdle = freezed,
+ Object? onTap = freezed,
+ Object? onLongPress = freezed,
+ Object? onMapCreated = freezed,
+ Object? cloudMapId = freezed,
+ }) {
+ return _then(_$MiraiGoogleMapImpl(
+ initialCameraPosition: null == initialCameraPosition
+ ? _value.initialCameraPosition
+ : initialCameraPosition // ignore: cast_nullable_to_non_nullable
+ as MiraiCameraPosition,
+ style: freezed == style
+ ? _value.style
+ : style // ignore: cast_nullable_to_non_nullable
+ as String?,
+ webGestureHandling: freezed == webGestureHandling
+ ? _value.webGestureHandling
+ : webGestureHandling // ignore: cast_nullable_to_non_nullable
+ as MiraiWebGestureHandling?,
+ compassEnabled: null == compassEnabled
+ ? _value.compassEnabled
+ : compassEnabled // ignore: cast_nullable_to_non_nullable
+ as bool,
+ mapToolbarEnabled: null == mapToolbarEnabled
+ ? _value.mapToolbarEnabled
+ : mapToolbarEnabled // ignore: cast_nullable_to_non_nullable
+ as bool,
+ cameraTargetBounds: freezed == cameraTargetBounds
+ ? _value.cameraTargetBounds
+ : cameraTargetBounds // ignore: cast_nullable_to_non_nullable
+ as MiraiCameraTargetBounds?,
+ mapType: null == mapType
+ ? _value.mapType
+ : mapType // ignore: cast_nullable_to_non_nullable
+ as MiraiGoogleMapType,
+ minMaxZoomPreference: freezed == minMaxZoomPreference
+ ? _value.minMaxZoomPreference
+ : minMaxZoomPreference // ignore: cast_nullable_to_non_nullable
+ as MiraiMinMaxZoomPreference?,
+ rotateGesturesEnabled: null == rotateGesturesEnabled
+ ? _value.rotateGesturesEnabled
+ : rotateGesturesEnabled // ignore: cast_nullable_to_non_nullable
+ as bool,
+ scrollGesturesEnabled: null == scrollGesturesEnabled
+ ? _value.scrollGesturesEnabled
+ : scrollGesturesEnabled // ignore: cast_nullable_to_non_nullable
+ as bool,
+ zoomControlsEnabled: null == zoomControlsEnabled
+ ? _value.zoomControlsEnabled
+ : zoomControlsEnabled // ignore: cast_nullable_to_non_nullable
+ as bool,
+ zoomGesturesEnabled: null == zoomGesturesEnabled
+ ? _value.zoomGesturesEnabled
+ : zoomGesturesEnabled // ignore: cast_nullable_to_non_nullable
+ as bool,
+ liteModeEnabled: null == liteModeEnabled
+ ? _value.liteModeEnabled
+ : liteModeEnabled // ignore: cast_nullable_to_non_nullable
+ as bool,
+ tiltGesturesEnabled: null == tiltGesturesEnabled
+ ? _value.tiltGesturesEnabled
+ : tiltGesturesEnabled // ignore: cast_nullable_to_non_nullable
+ as bool,
+ fortyFiveDegreeImageryEnabled: null == fortyFiveDegreeImageryEnabled
+ ? _value.fortyFiveDegreeImageryEnabled
+ : fortyFiveDegreeImageryEnabled // ignore: cast_nullable_to_non_nullable
+ as bool,
+ myLocationEnabled: null == myLocationEnabled
+ ? _value.myLocationEnabled
+ : myLocationEnabled // ignore: cast_nullable_to_non_nullable
+ as bool,
+ myLocationButtonEnabled: null == myLocationButtonEnabled
+ ? _value.myLocationButtonEnabled
+ : myLocationButtonEnabled // ignore: cast_nullable_to_non_nullable
+ as bool,
+ layoutDirection: freezed == layoutDirection
+ ? _value.layoutDirection
+ : layoutDirection // ignore: cast_nullable_to_non_nullable
+ as String?,
+ padding: null == padding
+ ? _value.padding
+ : padding // ignore: cast_nullable_to_non_nullable
+ as MiraiEdgeInsets,
+ indoorViewEnabled: null == indoorViewEnabled
+ ? _value.indoorViewEnabled
+ : indoorViewEnabled // ignore: cast_nullable_to_non_nullable
+ as bool,
+ trafficEnabled: null == trafficEnabled
+ ? _value.trafficEnabled
+ : trafficEnabled // ignore: cast_nullable_to_non_nullable
+ as bool,
+ buildingsEnabled: null == buildingsEnabled
+ ? _value.buildingsEnabled
+ : buildingsEnabled // ignore: cast_nullable_to_non_nullable
+ as bool,
+ markers: null == markers
+ ? _value._markers
+ : markers // ignore: cast_nullable_to_non_nullable
+ as Set,
+ circles: null == circles
+ ? _value._circles
+ : circles // ignore: cast_nullable_to_non_nullable
+ as Set,
+ polygons: null == polygons
+ ? _value._polygons
+ : polygons // ignore: cast_nullable_to_non_nullable
+ as Set,
+ polylines: null == polylines
+ ? _value._polylines
+ : polylines // ignore: cast_nullable_to_non_nullable
+ as Set,
+ tileOverlays: null == tileOverlays
+ ? _value._tileOverlays
+ : tileOverlays // ignore: cast_nullable_to_non_nullable
+ as Set,
+ onCameraMoveStarted: freezed == onCameraMoveStarted
+ ? _value._onCameraMoveStarted
+ : onCameraMoveStarted // ignore: cast_nullable_to_non_nullable
+ as Map?,
+ onCameraMove: freezed == onCameraMove
+ ? _value._onCameraMove
+ : onCameraMove // ignore: cast_nullable_to_non_nullable
+ as Map?,
+ onCameraIdle: freezed == onCameraIdle
+ ? _value._onCameraIdle
+ : onCameraIdle // ignore: cast_nullable_to_non_nullable
+ as Map?,
+ onTap: freezed == onTap
+ ? _value._onTap
+ : onTap // ignore: cast_nullable_to_non_nullable
+ as Map?,
+ onLongPress: freezed == onLongPress
+ ? _value._onLongPress
+ : onLongPress // ignore: cast_nullable_to_non_nullable
+ as Map?,
+ onMapCreated: freezed == onMapCreated
+ ? _value._onMapCreated
+ : onMapCreated // ignore: cast_nullable_to_non_nullable
+ as Map?,
+ cloudMapId: freezed == cloudMapId
+ ? _value.cloudMapId
+ : cloudMapId // ignore: cast_nullable_to_non_nullable
+ as String?,
+ ));
+ }
+}
+
+/// @nodoc
+@JsonSerializable()
+class _$MiraiGoogleMapImpl
+ with DiagnosticableTreeMixin
+ implements _MiraiGoogleMap {
+ const _$MiraiGoogleMapImpl(
+ {required this.initialCameraPosition,
+ this.style,
+ this.webGestureHandling,
+ this.compassEnabled = true,
+ this.mapToolbarEnabled = true,
+ this.cameraTargetBounds,
+ this.mapType = MiraiGoogleMapType.normal,
+ this.minMaxZoomPreference,
+ this.rotateGesturesEnabled = true,
+ this.scrollGesturesEnabled = true,
+ this.zoomControlsEnabled = true,
+ this.zoomGesturesEnabled = true,
+ this.liteModeEnabled = false,
+ this.tiltGesturesEnabled = true,
+ this.fortyFiveDegreeImageryEnabled = false,
+ this.myLocationEnabled = true,
+ required this.myLocationButtonEnabled,
+ this.layoutDirection,
+ this.padding = MiraiEdgeInsets.zero,
+ required this.indoorViewEnabled,
+ required this.trafficEnabled,
+ required this.buildingsEnabled,
+ final Set markers = const {},
+ final Set circles = const {},
+ final Set polygons = const {},
+ final Set polylines = const {},
+ final Set tileOverlays = const {},
+ final Map? onCameraMoveStarted,
+ final Map? onCameraMove,
+ final Map? onCameraIdle,
+ final Map? onTap,
+ final Map? onLongPress,
+ final Map? onMapCreated,
+ this.cloudMapId})
+ : _markers = markers,
+ _circles = circles,
+ _polygons = polygons,
+ _polylines = polylines,
+ _tileOverlays = tileOverlays,
+ _onCameraMoveStarted = onCameraMoveStarted,
+ _onCameraMove = onCameraMove,
+ _onCameraIdle = onCameraIdle,
+ _onTap = onTap,
+ _onLongPress = onLongPress,
+ _onMapCreated = onMapCreated;
+
+ factory _$MiraiGoogleMapImpl.fromJson(Map json) =>
+ _$$MiraiGoogleMapImplFromJson(json);
+
+// super.key,
+ @override
+ final MiraiCameraPosition initialCameraPosition;
+ @override
+ final String? style;
+// required Set> gestureRecognizers,
+ @override
+ final MiraiWebGestureHandling? webGestureHandling;
+ @override
+ @JsonKey()
+ final bool compassEnabled;
+ @override
+ @JsonKey()
+ final bool mapToolbarEnabled;
+ @override
+ final MiraiCameraTargetBounds? cameraTargetBounds;
+ @override
+ @JsonKey()
+ final MiraiGoogleMapType mapType;
+ @override
+ final MiraiMinMaxZoomPreference? minMaxZoomPreference;
+ @override
+ @JsonKey()
+ final bool rotateGesturesEnabled;
+ @override
+ @JsonKey()
+ final bool scrollGesturesEnabled;
+ @override
+ @JsonKey()
+ final bool zoomControlsEnabled;
+ @override
+ @JsonKey()
+ final bool zoomGesturesEnabled;
+ @override
+ @JsonKey()
+ final bool liteModeEnabled;
+ @override
+ @JsonKey()
+ final bool tiltGesturesEnabled;
+ @override
+ @JsonKey()
+ final bool fortyFiveDegreeImageryEnabled;
+ @override
+ @JsonKey()
+ final bool myLocationEnabled;
+ @override
+ final bool myLocationButtonEnabled;
+ @override
+ final String? layoutDirection;
+
+ /// If no padding is specified default padding will be 0.
+ @override
+ @JsonKey()
+ final MiraiEdgeInsets padding;
+ @override
+ final bool indoorViewEnabled;
+ @override
+ final bool trafficEnabled;
+ @override
+ final bool buildingsEnabled;
+ final Set _markers;
+ @override
+ @JsonKey()
+ Set get markers {
+ if (_markers is EqualUnmodifiableSetView) return _markers;
+ // ignore: implicit_dynamic_type
+ return EqualUnmodifiableSetView(_markers);
+ }
+
+ final Set _circles;
+ @override
+ @JsonKey()
+ Set get circles {
+ if (_circles is EqualUnmodifiableSetView) return _circles;
+ // ignore: implicit_dynamic_type
+ return EqualUnmodifiableSetView(_circles);
+ }
+
+ final Set _polygons;
+ @override
+ @JsonKey()
+ Set get polygons {
+ if (_polygons is EqualUnmodifiableSetView) return _polygons;
+ // ignore: implicit_dynamic_type
+ return EqualUnmodifiableSetView(_polygons);
+ }
+
+ final Set _polylines;
+ @override
+ @JsonKey()
+ Set get polylines {
+ if (_polylines is EqualUnmodifiableSetView) return _polylines;
+ // ignore: implicit_dynamic_type
+ return EqualUnmodifiableSetView(_polylines);
+ }
+
+ final Set _tileOverlays;
+ @override
+ @JsonKey()
+ Set get tileOverlays {
+ if (_tileOverlays is EqualUnmodifiableSetView) return _tileOverlays;
+ // ignore: implicit_dynamic_type
+ return EqualUnmodifiableSetView(_tileOverlays);
+ }
+
+ final Map? _onCameraMoveStarted;
+ @override
+ Map? get onCameraMoveStarted {
+ final value = _onCameraMoveStarted;
+ if (value == null) return null;
+ if (_onCameraMoveStarted is EqualUnmodifiableMapView)
+ return _onCameraMoveStarted;
+ // ignore: implicit_dynamic_type
+ return EqualUnmodifiableMapView(value);
+ }
+
+ final Map? _onCameraMove;
+ @override
+ Map? get onCameraMove {
+ final value = _onCameraMove;
+ if (value == null) return null;
+ if (_onCameraMove is EqualUnmodifiableMapView) return _onCameraMove;
+ // ignore: implicit_dynamic_type
+ return EqualUnmodifiableMapView(value);
+ }
+
+ final Map? _onCameraIdle;
+ @override
+ Map? get onCameraIdle {
+ final value = _onCameraIdle;
+ if (value == null) return null;
+ if (_onCameraIdle is EqualUnmodifiableMapView) return _onCameraIdle;
+ // ignore: implicit_dynamic_type
+ return EqualUnmodifiableMapView(value);
+ }
+
+ final Map? _onTap;
+ @override
+ Map? get onTap {
+ final value = _onTap;
+ if (value == null) return null;
+ if (_onTap is EqualUnmodifiableMapView) return _onTap;
+ // ignore: implicit_dynamic_type
+ return EqualUnmodifiableMapView(value);
+ }
+
+ final Map? _onLongPress;
+ @override
+ Map? get onLongPress {
+ final value = _onLongPress;
+ if (value == null) return null;
+ if (_onLongPress is EqualUnmodifiableMapView) return _onLongPress;
+ // ignore: implicit_dynamic_type
+ return EqualUnmodifiableMapView(value);
+ }
+
+ final Map? _onMapCreated;
+ @override
+ Map? get onMapCreated {
+ final value = _onMapCreated;
+ if (value == null) return null;
+ if (_onMapCreated is EqualUnmodifiableMapView) return _onMapCreated;
+ // ignore: implicit_dynamic_type
+ return EqualUnmodifiableMapView(value);
+ }
+
+ @override
+ final String? cloudMapId;
+
+ @override
+ String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) {
+ return 'MiraiGoogleMap(initialCameraPosition: $initialCameraPosition, style: $style, webGestureHandling: $webGestureHandling, compassEnabled: $compassEnabled, mapToolbarEnabled: $mapToolbarEnabled, cameraTargetBounds: $cameraTargetBounds, mapType: $mapType, minMaxZoomPreference: $minMaxZoomPreference, rotateGesturesEnabled: $rotateGesturesEnabled, scrollGesturesEnabled: $scrollGesturesEnabled, zoomControlsEnabled: $zoomControlsEnabled, zoomGesturesEnabled: $zoomGesturesEnabled, liteModeEnabled: $liteModeEnabled, tiltGesturesEnabled: $tiltGesturesEnabled, fortyFiveDegreeImageryEnabled: $fortyFiveDegreeImageryEnabled, myLocationEnabled: $myLocationEnabled, myLocationButtonEnabled: $myLocationButtonEnabled, layoutDirection: $layoutDirection, padding: $padding, indoorViewEnabled: $indoorViewEnabled, trafficEnabled: $trafficEnabled, buildingsEnabled: $buildingsEnabled, markers: $markers, circles: $circles, polygons: $polygons, polylines: $polylines, tileOverlays: $tileOverlays, onCameraMoveStarted: $onCameraMoveStarted, onCameraMove: $onCameraMove, onCameraIdle: $onCameraIdle, onTap: $onTap, onLongPress: $onLongPress, onMapCreated: $onMapCreated, cloudMapId: $cloudMapId)';
+ }
+
+ @override
+ void debugFillProperties(DiagnosticPropertiesBuilder properties) {
+ super.debugFillProperties(properties);
+ properties
+ ..add(DiagnosticsProperty('type', 'MiraiGoogleMap'))
+ ..add(DiagnosticsProperty('initialCameraPosition', initialCameraPosition))
+ ..add(DiagnosticsProperty('style', style))
+ ..add(DiagnosticsProperty('webGestureHandling', webGestureHandling))
+ ..add(DiagnosticsProperty('compassEnabled', compassEnabled))
+ ..add(DiagnosticsProperty('mapToolbarEnabled', mapToolbarEnabled))
+ ..add(DiagnosticsProperty('cameraTargetBounds', cameraTargetBounds))
+ ..add(DiagnosticsProperty('mapType', mapType))
+ ..add(DiagnosticsProperty('minMaxZoomPreference', minMaxZoomPreference))
+ ..add(DiagnosticsProperty('rotateGesturesEnabled', rotateGesturesEnabled))
+ ..add(DiagnosticsProperty('scrollGesturesEnabled', scrollGesturesEnabled))
+ ..add(DiagnosticsProperty('zoomControlsEnabled', zoomControlsEnabled))
+ ..add(DiagnosticsProperty('zoomGesturesEnabled', zoomGesturesEnabled))
+ ..add(DiagnosticsProperty('liteModeEnabled', liteModeEnabled))
+ ..add(DiagnosticsProperty('tiltGesturesEnabled', tiltGesturesEnabled))
+ ..add(DiagnosticsProperty(
+ 'fortyFiveDegreeImageryEnabled', fortyFiveDegreeImageryEnabled))
+ ..add(DiagnosticsProperty('myLocationEnabled', myLocationEnabled))
+ ..add(DiagnosticsProperty(
+ 'myLocationButtonEnabled', myLocationButtonEnabled))
+ ..add(DiagnosticsProperty('layoutDirection', layoutDirection))
+ ..add(DiagnosticsProperty('padding', padding))
+ ..add(DiagnosticsProperty('indoorViewEnabled', indoorViewEnabled))
+ ..add(DiagnosticsProperty('trafficEnabled', trafficEnabled))
+ ..add(DiagnosticsProperty('buildingsEnabled', buildingsEnabled))
+ ..add(DiagnosticsProperty('markers', markers))
+ ..add(DiagnosticsProperty('circles', circles))
+ ..add(DiagnosticsProperty('polygons', polygons))
+ ..add(DiagnosticsProperty('polylines', polylines))
+ ..add(DiagnosticsProperty('tileOverlays', tileOverlays))
+ ..add(DiagnosticsProperty('onCameraMoveStarted', onCameraMoveStarted))
+ ..add(DiagnosticsProperty('onCameraMove', onCameraMove))
+ ..add(DiagnosticsProperty('onCameraIdle', onCameraIdle))
+ ..add(DiagnosticsProperty('onTap', onTap))
+ ..add(DiagnosticsProperty('onLongPress', onLongPress))
+ ..add(DiagnosticsProperty('onMapCreated', onMapCreated))
+ ..add(DiagnosticsProperty('cloudMapId', cloudMapId));
+ }
+
+ @override
+ bool operator ==(Object other) {
+ return identical(this, other) ||
+ (other.runtimeType == runtimeType &&
+ other is _$MiraiGoogleMapImpl &&
+ (identical(other.initialCameraPosition, initialCameraPosition) ||
+ other.initialCameraPosition == initialCameraPosition) &&
+ (identical(other.style, style) || other.style == style) &&
+ (identical(other.webGestureHandling, webGestureHandling) ||
+ other.webGestureHandling == webGestureHandling) &&
+ (identical(other.compassEnabled, compassEnabled) ||
+ other.compassEnabled == compassEnabled) &&
+ (identical(other.mapToolbarEnabled, mapToolbarEnabled) ||
+ other.mapToolbarEnabled == mapToolbarEnabled) &&
+ (identical(other.cameraTargetBounds, cameraTargetBounds) ||
+ other.cameraTargetBounds == cameraTargetBounds) &&
+ (identical(other.mapType, mapType) || other.mapType == mapType) &&
+ (identical(other.minMaxZoomPreference, minMaxZoomPreference) ||
+ other.minMaxZoomPreference == minMaxZoomPreference) &&
+ (identical(other.rotateGesturesEnabled, rotateGesturesEnabled) ||
+ other.rotateGesturesEnabled == rotateGesturesEnabled) &&
+ (identical(other.scrollGesturesEnabled, scrollGesturesEnabled) ||
+ other.scrollGesturesEnabled == scrollGesturesEnabled) &&
+ (identical(other.zoomControlsEnabled, zoomControlsEnabled) ||
+ other.zoomControlsEnabled == zoomControlsEnabled) &&
+ (identical(other.zoomGesturesEnabled, zoomGesturesEnabled) ||
+ other.zoomGesturesEnabled == zoomGesturesEnabled) &&
+ (identical(other.liteModeEnabled, liteModeEnabled) ||
+ other.liteModeEnabled == liteModeEnabled) &&
+ (identical(other.tiltGesturesEnabled, tiltGesturesEnabled) ||
+ other.tiltGesturesEnabled == tiltGesturesEnabled) &&
+ (identical(other.fortyFiveDegreeImageryEnabled,
+ fortyFiveDegreeImageryEnabled) ||
+ other.fortyFiveDegreeImageryEnabled ==
+ fortyFiveDegreeImageryEnabled) &&
+ (identical(other.myLocationEnabled, myLocationEnabled) ||
+ other.myLocationEnabled == myLocationEnabled) &&
+ (identical(
+ other.myLocationButtonEnabled, myLocationButtonEnabled) ||
+ other.myLocationButtonEnabled == myLocationButtonEnabled) &&
+ (identical(other.layoutDirection, layoutDirection) ||
+ other.layoutDirection == layoutDirection) &&
+ (identical(other.padding, padding) || other.padding == padding) &&
+ (identical(other.indoorViewEnabled, indoorViewEnabled) ||
+ other.indoorViewEnabled == indoorViewEnabled) &&
+ (identical(other.trafficEnabled, trafficEnabled) ||
+ other.trafficEnabled == trafficEnabled) &&
+ (identical(other.buildingsEnabled, buildingsEnabled) ||
+ other.buildingsEnabled == buildingsEnabled) &&
+ const DeepCollectionEquality().equals(other._markers, _markers) &&
+ const DeepCollectionEquality().equals(other._circles, _circles) &&
+ const DeepCollectionEquality().equals(other._polygons, _polygons) &&
+ const DeepCollectionEquality()
+ .equals(other._polylines, _polylines) &&
+ const DeepCollectionEquality()
+ .equals(other._tileOverlays, _tileOverlays) &&
+ const DeepCollectionEquality()
+ .equals(other._onCameraMoveStarted, _onCameraMoveStarted) &&
+ const DeepCollectionEquality()
+ .equals(other._onCameraMove, _onCameraMove) &&
+ const DeepCollectionEquality()
+ .equals(other._onCameraIdle, _onCameraIdle) &&
+ const DeepCollectionEquality().equals(other._onTap, _onTap) &&
+ const DeepCollectionEquality()
+ .equals(other._onLongPress, _onLongPress) &&
+ const DeepCollectionEquality()
+ .equals(other._onMapCreated, _onMapCreated) &&
+ (identical(other.cloudMapId, cloudMapId) ||
+ other.cloudMapId == cloudMapId));
+ }
+
+ @JsonKey(ignore: true)
+ @override
+ int get hashCode => Object.hashAll([
+ runtimeType,
+ initialCameraPosition,
+ style,
+ webGestureHandling,
+ compassEnabled,
+ mapToolbarEnabled,
+ cameraTargetBounds,
+ mapType,
+ minMaxZoomPreference,
+ rotateGesturesEnabled,
+ scrollGesturesEnabled,
+ zoomControlsEnabled,
+ zoomGesturesEnabled,
+ liteModeEnabled,
+ tiltGesturesEnabled,
+ fortyFiveDegreeImageryEnabled,
+ myLocationEnabled,
+ myLocationButtonEnabled,
+ layoutDirection,
+ padding,
+ indoorViewEnabled,
+ trafficEnabled,
+ buildingsEnabled,
+ const DeepCollectionEquality().hash(_markers),
+ const DeepCollectionEquality().hash(_circles),
+ const DeepCollectionEquality().hash(_polygons),
+ const DeepCollectionEquality().hash(_polylines),
+ const DeepCollectionEquality().hash(_tileOverlays),
+ const DeepCollectionEquality().hash(_onCameraMoveStarted),
+ const DeepCollectionEquality().hash(_onCameraMove),
+ const DeepCollectionEquality().hash(_onCameraIdle),
+ const DeepCollectionEquality().hash(_onTap),
+ const DeepCollectionEquality().hash(_onLongPress),
+ const DeepCollectionEquality().hash(_onMapCreated),
+ cloudMapId
+ ]);
+
+ @JsonKey(ignore: true)
+ @override
+ @pragma('vm:prefer-inline')
+ _$$MiraiGoogleMapImplCopyWith<_$MiraiGoogleMapImpl> get copyWith =>
+ __$$MiraiGoogleMapImplCopyWithImpl<_$MiraiGoogleMapImpl>(
+ this, _$identity);
+
+ @override
+ Map toJson() {
+ return _$$MiraiGoogleMapImplToJson(
+ this,
+ );
+ }
+}
+
+abstract class _MiraiGoogleMap implements MiraiGoogleMap {
+ const factory _MiraiGoogleMap(
+ {required final MiraiCameraPosition initialCameraPosition,
+ final String? style,
+ final MiraiWebGestureHandling? webGestureHandling,
+ final bool compassEnabled,
+ final bool mapToolbarEnabled,
+ final MiraiCameraTargetBounds? cameraTargetBounds,
+ final MiraiGoogleMapType mapType,
+ final MiraiMinMaxZoomPreference? minMaxZoomPreference,
+ final bool rotateGesturesEnabled,
+ final bool scrollGesturesEnabled,
+ final bool zoomControlsEnabled,
+ final bool zoomGesturesEnabled,
+ final bool liteModeEnabled,
+ final bool tiltGesturesEnabled,
+ final bool fortyFiveDegreeImageryEnabled,
+ final bool myLocationEnabled,
+ required final bool myLocationButtonEnabled,
+ final String? layoutDirection,
+ final MiraiEdgeInsets padding,
+ required final bool indoorViewEnabled,
+ required final bool trafficEnabled,
+ required final bool buildingsEnabled,
+ final Set markers,
+ final Set circles,
+ final Set polygons,
+ final Set polylines,
+ final Set tileOverlays,
+ final Map? onCameraMoveStarted,
+ final Map? onCameraMove,
+ final Map? onCameraIdle,
+ final Map? onTap,
+ final Map? onLongPress,
+ final Map? onMapCreated,
+ final String? cloudMapId}) = _$MiraiGoogleMapImpl;
+
+ factory _MiraiGoogleMap.fromJson(Map json) =
+ _$MiraiGoogleMapImpl.fromJson;
+
+ @override // super.key,
+ MiraiCameraPosition get initialCameraPosition;
+ @override
+ String? get style;
+ @override // required Set> gestureRecognizers,
+ MiraiWebGestureHandling? get webGestureHandling;
+ @override
+ bool get compassEnabled;
+ @override
+ bool get mapToolbarEnabled;
+ @override
+ MiraiCameraTargetBounds? get cameraTargetBounds;
+ @override
+ MiraiGoogleMapType get mapType;
+ @override
+ MiraiMinMaxZoomPreference? get minMaxZoomPreference;
+ @override
+ bool get rotateGesturesEnabled;
+ @override
+ bool get scrollGesturesEnabled;
+ @override
+ bool get zoomControlsEnabled;
+ @override
+ bool get zoomGesturesEnabled;
+ @override
+ bool get liteModeEnabled;
+ @override
+ bool get tiltGesturesEnabled;
+ @override
+ bool get fortyFiveDegreeImageryEnabled;
+ @override
+ bool get myLocationEnabled;
+ @override
+ bool get myLocationButtonEnabled;
+ @override
+ String? get layoutDirection;
+ @override
+
+ /// If no padding is specified default padding will be 0.
+ MiraiEdgeInsets get padding;
+ @override
+ bool get indoorViewEnabled;
+ @override
+ bool get trafficEnabled;
+ @override
+ bool get buildingsEnabled;
+ @override
+ Set get markers;
+ @override
+ Set get circles;
+ @override
+ Set get polygons;
+ @override
+ Set get polylines;
+ @override
+ Set get tileOverlays;
+ @override
+ Map? get onCameraMoveStarted;
+ @override
+ Map? get onCameraMove;
+ @override
+ Map? get onCameraIdle;
+ @override
+ Map? get onTap;
+ @override
+ Map? get onLongPress;
+ @override
+ Map? get onMapCreated;
+ @override
+ String? get cloudMapId;
+ @override
+ @JsonKey(ignore: true)
+ _$$MiraiGoogleMapImplCopyWith<_$MiraiGoogleMapImpl> get copyWith =>
+ throw _privateConstructorUsedError;
+}
diff --git a/packages/mirai/lib/src/parsers/mirai_google_map/mirai_google_map.g.dart b/packages/mirai/lib/src/parsers/mirai_google_map/mirai_google_map.g.dart
new file mode 100644
index 00000000..3f889e6c
--- /dev/null
+++ b/packages/mirai/lib/src/parsers/mirai_google_map/mirai_google_map.g.dart
@@ -0,0 +1,128 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'mirai_google_map.dart';
+
+// **************************************************************************
+// JsonSerializableGenerator
+// **************************************************************************
+
+_$MiraiGoogleMapImpl _$$MiraiGoogleMapImplFromJson(Map json) =>
+ _$MiraiGoogleMapImpl(
+ initialCameraPosition: MiraiCameraPosition.fromJson(
+ json['initialCameraPosition'] as Map),
+ style: json['style'] as String?,
+ webGestureHandling: $enumDecodeNullable(
+ _$MiraiWebGestureHandlingEnumMap, json['webGestureHandling']),
+ compassEnabled: json['compassEnabled'] as bool? ?? true,
+ mapToolbarEnabled: json['mapToolbarEnabled'] as bool? ?? true,
+ cameraTargetBounds: json['cameraTargetBounds'] == null
+ ? null
+ : MiraiCameraTargetBounds.fromJson(
+ json['cameraTargetBounds'] as Map),
+ mapType:
+ $enumDecodeNullable(_$MiraiGoogleMapTypeEnumMap, json['mapType']) ??
+ MiraiGoogleMapType.normal,
+ minMaxZoomPreference: json['minMaxZoomPreference'] == null
+ ? null
+ : MiraiMinMaxZoomPreference.fromJson(
+ json['minMaxZoomPreference'] as Map),
+ rotateGesturesEnabled: json['rotateGesturesEnabled'] as bool? ?? true,
+ scrollGesturesEnabled: json['scrollGesturesEnabled'] as bool? ?? true,
+ zoomControlsEnabled: json['zoomControlsEnabled'] as bool? ?? true,
+ zoomGesturesEnabled: json['zoomGesturesEnabled'] as bool? ?? true,
+ liteModeEnabled: json['liteModeEnabled'] as bool? ?? false,
+ tiltGesturesEnabled: json['tiltGesturesEnabled'] as bool? ?? true,
+ fortyFiveDegreeImageryEnabled:
+ json['fortyFiveDegreeImageryEnabled'] as bool? ?? false,
+ myLocationEnabled: json['myLocationEnabled'] as bool? ?? true,
+ myLocationButtonEnabled: json['myLocationButtonEnabled'] as bool,
+ layoutDirection: json['layoutDirection'] as String?,
+ padding: json['padding'] == null
+ ? MiraiEdgeInsets.zero
+ : MiraiEdgeInsets.fromJson(json['padding']),
+ indoorViewEnabled: json['indoorViewEnabled'] as bool,
+ trafficEnabled: json['trafficEnabled'] as bool,
+ buildingsEnabled: json['buildingsEnabled'] as bool,
+ markers: (json['markers'] as List?)
+ ?.map((e) => MiraiMarker.fromJson(e as Map))
+ .toSet() ??
+ const {},
+ circles: (json['circles'] as List?)
+ ?.map((e) => MiraiCircle.fromJson(e as Map))
+ .toSet() ??
+ const {},
+ polygons: (json['polygons'] as List?)
+ ?.map((e) => MiraiPolygon.fromJson(e as Map))
+ .toSet() ??
+ const {},
+ polylines: (json['polylines'] as List?)
+ ?.map((e) => MiraiPolyline.fromJson(e as Map))
+ .toSet() ??
+ const {},
+ tileOverlays: (json['tileOverlays'] as List?)
+ ?.map((e) => MiraiTileOverlay.fromJson(e as Map))
+ .toSet() ??
+ const {},
+ onCameraMoveStarted: json['onCameraMoveStarted'] as Map?,
+ onCameraMove: json['onCameraMove'] as Map?,
+ onCameraIdle: json['onCameraIdle'] as Map?,
+ onTap: json['onTap'] as Map?,
+ onLongPress: json['onLongPress'] as Map?,
+ onMapCreated: json['onMapCreated'] as Map?,
+ cloudMapId: json['cloudMapId'] as String?,
+ );
+
+Map _$$MiraiGoogleMapImplToJson(
+ _$MiraiGoogleMapImpl instance) =>
+ {
+ 'initialCameraPosition': instance.initialCameraPosition,
+ 'style': instance.style,
+ 'webGestureHandling':
+ _$MiraiWebGestureHandlingEnumMap[instance.webGestureHandling],
+ 'compassEnabled': instance.compassEnabled,
+ 'mapToolbarEnabled': instance.mapToolbarEnabled,
+ 'cameraTargetBounds': instance.cameraTargetBounds,
+ 'mapType': _$MiraiGoogleMapTypeEnumMap[instance.mapType]!,
+ 'minMaxZoomPreference': instance.minMaxZoomPreference,
+ 'rotateGesturesEnabled': instance.rotateGesturesEnabled,
+ 'scrollGesturesEnabled': instance.scrollGesturesEnabled,
+ 'zoomControlsEnabled': instance.zoomControlsEnabled,
+ 'zoomGesturesEnabled': instance.zoomGesturesEnabled,
+ 'liteModeEnabled': instance.liteModeEnabled,
+ 'tiltGesturesEnabled': instance.tiltGesturesEnabled,
+ 'fortyFiveDegreeImageryEnabled': instance.fortyFiveDegreeImageryEnabled,
+ 'myLocationEnabled': instance.myLocationEnabled,
+ 'myLocationButtonEnabled': instance.myLocationButtonEnabled,
+ 'layoutDirection': instance.layoutDirection,
+ 'padding': instance.padding,
+ 'indoorViewEnabled': instance.indoorViewEnabled,
+ 'trafficEnabled': instance.trafficEnabled,
+ 'buildingsEnabled': instance.buildingsEnabled,
+ 'markers': instance.markers.toList(),
+ 'circles': instance.circles.toList(),
+ 'polygons': instance.polygons.toList(),
+ 'polylines': instance.polylines.toList(),
+ 'tileOverlays': instance.tileOverlays.toList(),
+ 'onCameraMoveStarted': instance.onCameraMoveStarted,
+ 'onCameraMove': instance.onCameraMove,
+ 'onCameraIdle': instance.onCameraIdle,
+ 'onTap': instance.onTap,
+ 'onLongPress': instance.onLongPress,
+ 'onMapCreated': instance.onMapCreated,
+ 'cloudMapId': instance.cloudMapId,
+ };
+
+const _$MiraiWebGestureHandlingEnumMap = {
+ MiraiWebGestureHandling.cooperative: 'cooperative',
+ MiraiWebGestureHandling.greedy: 'greedy',
+ MiraiWebGestureHandling.none: 'none',
+ MiraiWebGestureHandling.auto: 'auto',
+};
+
+const _$MiraiGoogleMapTypeEnumMap = {
+ MiraiGoogleMapType.none: 'none',
+ MiraiGoogleMapType.normal: 'normal',
+ MiraiGoogleMapType.satellite: 'satellite',
+ MiraiGoogleMapType.terrain: 'terrain',
+ MiraiGoogleMapType.hybrid: 'hybrid',
+};
diff --git a/packages/mirai/lib/src/parsers/mirai_google_map/mirai_google_map_parser.dart b/packages/mirai/lib/src/parsers/mirai_google_map/mirai_google_map_parser.dart
new file mode 100644
index 00000000..90d09a45
--- /dev/null
+++ b/packages/mirai/lib/src/parsers/mirai_google_map/mirai_google_map_parser.dart
@@ -0,0 +1,126 @@
+import 'dart:async';
+import 'dart:convert';
+import 'dart:developer';
+
+import 'package:flutter/material.dart';
+import 'package:mirai/src/parsers/mirai_edge_insets/mirai_edge_insets.dart';
+import 'package:mirai/src/utils/widget_type.dart';
+import 'package:mirai_framework/mirai_framework.dart';
+import 'package:google_maps_flutter/google_maps_flutter.dart';
+
+import 'mirai_google_map.dart';
+
+class MiraiGoogleMapParser extends MiraiParser {
+ const MiraiGoogleMapParser();
+
+ static final mapWidgetKey = GlobalKey();
+
+ @override
+ String get type => WidgetType.googleMap.name;
+
+ @override
+ MiraiGoogleMap getModel(Map json) => MiraiGoogleMap.fromJson(json);
+
+ @override
+ Widget parse(BuildContext context, MiraiGoogleMap model) {
+ return _GoogleMapWidget(
+ key: mapWidgetKey,
+ model: model,
+ );
+ }
+}
+
+class _GoogleMapWidget extends StatefulWidget {
+ const _GoogleMapWidget({super.key, required this.model});
+
+ final MiraiGoogleMap model;
+
+ @override
+ State<_GoogleMapWidget> createState() => __GoogleMapWidgetState();
+}
+
+class __GoogleMapWidgetState extends State<_GoogleMapWidget> {
+ GoogleMapController? _googleMapController;
+ late MiraiGoogleMap model = widget.model;
+
+ @override
+ void initState() {
+ super.initState();
+ }
+
+@override
+ void didUpdateWidget(covariant _GoogleMapWidget oldWidget) {
+ super.didUpdateWidget(oldWidget);
+ if(widget.model != model){
+ setState(() => model = widget.model);
+ }
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ final model = widget.model;
+ return GoogleMap(
+ initialCameraPosition: model.initialCameraPosition.parse,
+ style: model.style,
+ webGestureHandling: model.webGestureHandling?.value,
+ compassEnabled: model.compassEnabled,
+ mapToolbarEnabled: model.mapToolbarEnabled,
+ cameraTargetBounds: model.cameraTargetBounds?.parse ?? CameraTargetBounds.unbounded,
+ mapType: model.mapType.value,
+ minMaxZoomPreference: model.minMaxZoomPreference?.parse ?? MinMaxZoomPreference.unbounded,
+ rotateGesturesEnabled: model.rotateGesturesEnabled,
+ scrollGesturesEnabled: model.scrollGesturesEnabled,
+ zoomControlsEnabled: model.zoomControlsEnabled,
+ zoomGesturesEnabled: model.zoomGesturesEnabled,
+ liteModeEnabled: model.liteModeEnabled,
+ tiltGesturesEnabled: model.tiltGesturesEnabled,
+ fortyFiveDegreeImageryEnabled: model.fortyFiveDegreeImageryEnabled,
+ myLocationEnabled: model.myLocationEnabled,
+ myLocationButtonEnabled: model.myLocationButtonEnabled,
+ layoutDirection: model.layoutDirection == "rtl" ? TextDirection.rtl : TextDirection.ltr,
+
+ // If no padding is specified default padding will be 0.
+ padding: model.padding.parse,
+ indoorViewEnabled: model.indoorViewEnabled,
+ trafficEnabled: model.trafficEnabled,
+ buildingsEnabled: model.buildingsEnabled,
+ markers: model.markers
+ .map((e) => e.parse(
+ onTap: () {},
+ onDrag: (value) {},
+ onDragStart: (value) {},
+ onDragEnd: (value) {},
+ ))
+ .toSet(),
+ circles: model.circles
+ .map((e) => e.parse(
+ context,
+ onTap: () {},
+ ))
+ .toSet(),
+ polygons: model.polygons
+ .map((e) => e.parse(
+ context,
+ onTap: () {},
+ ))
+ .toSet(),
+ polylines: model.polylines
+ .map((e) => e.parse(
+ context,
+ onTap: () {},
+ ))
+ .toSet(),
+ tileOverlays: model.tileOverlays.map((e) => e.parse).toSet(),
+ onCameraMoveStarted:
+ model.onCameraMoveStarted == null ? null : () => model.onCameraMoveStarted,
+ onCameraMove: model.onCameraMove == null ? null : (_) => model.onCameraMove,
+ onCameraIdle: model.onCameraIdle == null ? null : () => model.onCameraIdle,
+ onLongPress: model.onLongPress == null ? null : (_) => model.onLongPress,
+ onTap: model.onTap == null ? null : (_) => model.onTap,
+ onMapCreated: (controller) {
+ _googleMapController = controller;
+ },
+ cloudMapId: model.cloudMapId,
+ );
+ }
+}
diff --git a/packages/mirai/lib/src/parsers/mirai_google_map/mirai_google_map_types/mirai_google_map_camera.dart b/packages/mirai/lib/src/parsers/mirai_google_map/mirai_google_map_types/mirai_google_map_camera.dart
new file mode 100644
index 00000000..c0b12193
--- /dev/null
+++ b/packages/mirai/lib/src/parsers/mirai_google_map/mirai_google_map_types/mirai_google_map_camera.dart
@@ -0,0 +1,148 @@
+import 'package:freezed_annotation/freezed_annotation.dart';
+import 'package:google_maps_flutter/google_maps_flutter.dart';
+import 'mirai_google_map_ui.dart';
+
+part 'mirai_google_map_camera.freezed.dart';
+part 'mirai_google_map_camera.g.dart';
+
+@freezed
+class MiraiCameraPosition with _$MiraiCameraPosition {
+ const factory MiraiCameraPosition({
+ @Default(0.0) double bearing,
+ required MiraiLatLng target,
+ @Default(0.0) double tilt,
+ @Default(0.0) double zoom,
+ }) = _MiraiCameraPosition;
+
+ factory MiraiCameraPosition.fromJson(Map json) =>
+ _$MiraiCameraPositionFromJson(json);
+}
+
+extension MiraiCameraPositionParser on MiraiCameraPosition {
+ CameraPosition get parse {
+ return CameraPosition(
+ target: target.parse,
+ bearing: bearing,
+ tilt: tilt,
+ zoom: zoom,
+ );
+ }
+}
+
+
+
+// @freezed
+// class MiraiCameraUpdate with _$MiraiCameraUpdate {
+// const MiraiCameraUpdate._();
+
+// const factory MiraiCameraUpdate(Object _json) = MiraiCameraUpdate;
+
+// /// Returns a camera update that moves the camera to the specified position.
+// static MiraiCameraUpdate newCameraPosition(MiraiCameraPosition cameraPosition) {
+// return MiraiCameraUpdate(
+//