Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added fonts/MyFlutterApp.ttf
Binary file not shown.
66 changes: 66 additions & 0 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,27 +1,93 @@
PODS:
- AppAuth (1.7.6):
- AppAuth/Core (= 1.7.6)
- AppAuth/ExternalUserAgent (= 1.7.6)
- AppAuth/Core (1.7.6)
- AppAuth/ExternalUserAgent (1.7.6):
- AppAuth/Core
- AppCheckCore (11.2.0):
- GoogleUtilities/Environment (~> 8.0)
- GoogleUtilities/UserDefaults (~> 8.0)
- PromisesObjC (~> 2.4)
- Flutter (1.0.0)
- flutter_secure_storage (6.0.0):
- Flutter
- google_sign_in_ios (0.0.1):
- AppAuth (>= 1.7.4)
- Flutter
- FlutterMacOS
- GoogleSignIn (~> 8.0)
- GTMSessionFetcher (>= 3.4.0)
- GoogleSignIn (8.0.0):
- AppAuth (< 2.0, >= 1.7.3)
- AppCheckCore (~> 11.0)
- GTMAppAuth (< 5.0, >= 4.1.1)
- GTMSessionFetcher/Core (~> 3.3)
- GoogleUtilities/Environment (8.1.0):
- GoogleUtilities/Privacy
- GoogleUtilities/Logger (8.1.0):
- GoogleUtilities/Environment
- GoogleUtilities/Privacy
- GoogleUtilities/Privacy (8.1.0)
- GoogleUtilities/UserDefaults (8.1.0):
- GoogleUtilities/Logger
- GoogleUtilities/Privacy
- GTMAppAuth (4.1.1):
- AppAuth/Core (~> 1.7)
- GTMSessionFetcher/Core (< 4.0, >= 3.3)
- GTMSessionFetcher (3.5.0):
- GTMSessionFetcher/Full (= 3.5.0)
- GTMSessionFetcher/Core (3.5.0)
- GTMSessionFetcher/Full (3.5.0):
- GTMSessionFetcher/Core
- path_provider_foundation (0.0.1):
- Flutter
- FlutterMacOS
- PromisesObjC (2.4.0)
- url_launcher_ios (0.0.1):
- Flutter

DEPENDENCIES:
- Flutter (from `Flutter`)
- flutter_secure_storage (from `.symlinks/plugins/flutter_secure_storage/ios`)
- google_sign_in_ios (from `.symlinks/plugins/google_sign_in_ios/darwin`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)

SPEC REPOS:
https://github.com/CocoaPods/Specs.git:
- AppAuth
- AppCheckCore
- GoogleSignIn
- GoogleUtilities
- GTMAppAuth
- GTMSessionFetcher
- PromisesObjC

EXTERNAL SOURCES:
Flutter:
:path: Flutter
flutter_secure_storage:
:path: ".symlinks/plugins/flutter_secure_storage/ios"
google_sign_in_ios:
:path: ".symlinks/plugins/google_sign_in_ios/darwin"
path_provider_foundation:
:path: ".symlinks/plugins/path_provider_foundation/darwin"
url_launcher_ios:
:path: ".symlinks/plugins/url_launcher_ios/ios"

SPEC CHECKSUMS:
AppAuth: d4f13a8fe0baf391b2108511793e4b479691fb73
AppCheckCore: cc8fd0a3a230ddd401f326489c99990b013f0c4f
Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467
flutter_secure_storage: 1ed9476fba7e7a782b22888f956cce43e2c62f13
google_sign_in_ios: b48bb9af78576358a168361173155596c845f0b9
GoogleSignIn: ce8c89bb9b37fb624b92e7514cc67335d1e277e4
GoogleUtilities: 00c88b9a86066ef77f0da2fab05f65d7768ed8e1
GTMAppAuth: f69bd07d68cd3b766125f7e072c45d7340dea0de
GTMSessionFetcher: 5aea5ba6bd522a239e236100971f10cb71b96ab6
path_provider_foundation: bb55f6dbba17d0dccd6737fe6f7f34fbd0376880
PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47
url_launcher_ios: 7a95fa5b60cc718a708b8f2966718e93db0cef1b

PODFILE CHECKSUM: 9ca1682d392c3b88ad6d313259873375a305cdca
Expand Down
18 changes: 18 additions & 0 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
822A1621A2D03696D9D1A291 /* [CP] Embed Pods Frameworks */,
25F51009C59A158A4262BF07 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
Expand Down Expand Up @@ -270,6 +271,23 @@
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
25F51009C59A158A4262BF07 /* [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;
};
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
Expand Down
26 changes: 26 additions & 0 deletions lib/features/map/models/drawing_path.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import 'dart:ui';
import 'package:latlong2/latlong.dart';

class DrawingPath {
final List<LatLng> points;
final Color color;
final double strokeWidth;

DrawingPath({
required this.points,
required this.color,
required this.strokeWidth,
});

DrawingPath copyWith({
List<LatLng>? points,
Color? color,
double? strokeWidth,
}) {
return DrawingPath(
points: points ?? this.points,
color: color ?? this.color,
strokeWidth: strokeWidth ?? this.strokeWidth,
);
}
}
155 changes: 98 additions & 57 deletions lib/features/map/presentation/map_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import 'package:latlong2/latlong.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:memomap/features/auth/providers/auth_provider.dart';
import 'package:memomap/features/map/providers/pin_provider.dart';
import 'package:memomap/features/map/providers/drawing_provider.dart';
import 'package:memomap/features/map/presentation/widgets/drawing_canvas.dart';
import 'package:memomap/features/map/presentation/widgets/controls.dart';

class MapScreen extends ConsumerStatefulWidget {
const MapScreen({super.key});
Expand Down Expand Up @@ -46,6 +49,7 @@ class _MapScreenState extends ConsumerState<MapScreen> {
final isAuthenticated = ref.watch(isAuthenticatedProvider);
final user = ref.watch(currentUserProvider);
final pinsAsync = ref.watch(pinsProvider);
final drawingState = ref.watch(drawingProvider);

return Scaffold(
appBar: AppBar(
Expand All @@ -64,70 +68,107 @@ class _MapScreenState extends ConsumerState<MapScreen> {
),
IconButton(
icon: Icon(isAuthenticated ? Icons.person : Icons.login),
onPressed: () => context.push(isAuthenticated ? '/profile' : '/login'),
onPressed: () =>
context.push(isAuthenticated ? '/profile' : '/login'),
tooltip: isAuthenticated ? 'Profile' : 'Login',
),
],
),
body: FlutterMap(
mapController: _mapController,
options: MapOptions(
initialCenter: const LatLng(35.6895, 139.6917),
initialZoom: 9.2,
interactionOptions: const InteractionOptions(
flags: InteractiveFlag.all & ~InteractiveFlag.doubleTapZoom,
),
onTap: (tapPosition, latlng) {
ref.read(pinsProvider.notifier).addPin(latlng);
},
),
children: [
TileLayer(
urlTemplate: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png',
userAgentPackageName: 'dev.fleaflet.flutter_map.example',
),
MarkerLayer(
markers: pinsAsync.when(
data: _buildMarkers,
loading: () => [],
error: (_, _) => [],
),
),
RichAttributionWidget(
alignment: AttributionAlignment.bottomLeft,
attributions: [
TextSourceAttribution(
'OpenStreetMap contributors',
onTap: () =>
launchUrl(Uri.parse('https://openstreetmap.org/copyright')),
),
],
),
],
),
floatingActionButton: Column(
mainAxisAlignment: MainAxisAlignment.end,
body: Column(
children: [
FloatingActionButton(
heroTag: 'zoom_in',
onPressed: () => _mapController.move(
_mapController.camera.center,
_mapController.camera.zoom + 1,
),
tooltip: 'Zoom in',
child: const Icon(Icons.add),
),
const SizedBox(height: 8),
FloatingActionButton(
heroTag: 'zoom_out',
onPressed: () => _mapController.move(
_mapController.camera.center,
_mapController.camera.zoom - 1,
Expanded(
child: Stack(
children: [
FlutterMap(
mapController: _mapController,
options: MapOptions(
initialCenter: const LatLng(35.6895, 139.6917),
initialZoom: 9.2,
interactionOptions: InteractionOptions(
flags: drawingState.isDrawingMode
? InteractiveFlag.none
: InteractiveFlag.all &
~InteractiveFlag.doubleTapZoom,
),
onTap: (tapPosition, latlng) {
if (!drawingState.isDrawingMode) {
ref.read(pinsProvider.notifier).addPin(latlng);
}
},
),
children: [
TileLayer(
urlTemplate:
'https://tile.openstreetmap.org/{z}/{x}/{y}.png',
userAgentPackageName: 'dev.fleaflet.flutter_map.example',
),
PolylineLayer(
polylines: drawingState.paths
.map(
(path) => Polyline(
points: path.points,
color: path.color,
strokeWidth: path.strokeWidth,
),
)
.toList(),
),
MarkerLayer(
markers: pinsAsync.when(
data: _buildMarkers,
loading: () => [],
error: (_, _) => [],
),
),
RichAttributionWidget(
alignment: AttributionAlignment.bottomLeft,
attributions: [
TextSourceAttribution(
'OpenStreetMap contributors',
onTap: () => launchUrl(
Uri.parse('https://openstreetmap.org/copyright'),
),
),
],
),
],
),
IgnorePointer(
ignoring: !drawingState.isDrawingMode,
child: DrawingCanvas(mapController: _mapController),
),
Positioned(
right: 16,
bottom: 16,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
FloatingActionButton(
heroTag: 'zoom_in',
onPressed: () => _mapController.move(
_mapController.camera.center,
_mapController.camera.zoom + 1,
),
tooltip: 'Zoom in',
child: const Icon(Icons.add),
),
const SizedBox(height: 8),
FloatingActionButton(
heroTag: 'zoom_out',
onPressed: () => _mapController.move(
_mapController.camera.center,
_mapController.camera.zoom - 1,
),
tooltip: 'Zoom out',
child: const Icon(Icons.remove),
),
],
),
),
],
),
tooltip: 'Zoom out',
child: const Icon(Icons.remove),
),
const SizedBox(height: 8),
const Controls(),
],
),
);
Expand Down
Loading