LoginPage #60
File diff suppressed because one or more lines are too long
12
lib/Map.dart
12
lib/Map.dart
|
@ -159,6 +159,7 @@ class MapState extends State<Map> {
|
||||||
body: Stack (
|
body: Stack (
|
||||||
children: [
|
children: [
|
||||||
GoogleMap(
|
GoogleMap(
|
||||||
|
zoomControlsEnabled: true,
|
||||||
cameraTargetBounds: CameraTargetBounds(LatLngBounds(
|
cameraTargetBounds: CameraTargetBounds(LatLngBounds(
|
||||||
northeast: const LatLng(59.3474696569038, 18.1001602476002147),
|
northeast: const LatLng(59.3474696569038, 18.1001602476002147),
|
||||||
southwest: const LatLng(59.297332547922636, 17.999522500277884))),
|
southwest: const LatLng(59.297332547922636, 17.999522500277884))),
|
||||||
|
@ -189,17 +190,6 @@ class MapState extends State<Map> {
|
||||||
// ,child: const Text("Search Placses"))
|
// ,child: const Text("Search Placses"))
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
floatingActionButton: Padding(
|
|
||||||
padding: const EdgeInsets.only(top: 100.0),
|
|
||||||
child: FloatingActionButton(
|
|
||||||
onPressed: () {
|
|
||||||
Navigator.push(context,
|
|
||||||
MaterialPageRoute(builder: (context) => const SettingsPage()));
|
|
||||||
},
|
|
||||||
backgroundColor: Colors.purple,
|
|
||||||
child: const Icon(Icons.filter_alt),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
floatingActionButtonLocation: FloatingActionButtonLocation.endTop,
|
floatingActionButtonLocation: FloatingActionButtonLocation.endTop,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,22 +29,6 @@ class Venue {
|
||||||
LatLng tempPosition = LatLng(double.parse(splitArr[1]), double.parse(splitArr[0]));
|
LatLng tempPosition = LatLng(double.parse(splitArr[1]), double.parse(splitArr[0]));
|
||||||
|
|
||||||
|
|
||||||
/* print(splitArr[0].toString() + ' : ' + splitArr[1].toString());
|
|
||||||
print('Coordinates: ' + tempCoordinates);
|
|
||||||
print('Parsed: ' + double.parse(splitArr[0]).toString());
|
|
||||||
print(LatLng(double.parse(splitArr[1]), double.parse(splitArr[0])));
|
|
||||||
print(tempAddress + tempName);
|
|
||||||
print(tempPosition.latitude.toString() + " " + splitArr[0]);*/
|
|
||||||
|
|
||||||
// print('Json-Object:');
|
|
||||||
// print(json);
|
|
||||||
|
|
||||||
// print(venues);
|
|
||||||
// print(json['name']);
|
|
||||||
// print(json['address']);
|
|
||||||
// print(json['streetNo']);
|
|
||||||
// print(json['coordinates']);
|
|
||||||
|
|
||||||
if (tempName != null &&
|
if (tempName != null &&
|
||||||
tempAddress != null &&
|
tempAddress != null &&
|
||||||
tempStreetNo != null &&
|
tempStreetNo != null &&
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:share_plus/share_plus.dart';
|
import 'package:share_plus/share_plus.dart';
|
||||||
import 'package:flutter_applicationdemo/Venue.dart';
|
import 'package:flutter_applicationdemo/Venue.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
@ -253,7 +252,7 @@ class LikeVenueButton extends StatelessWidget {
|
||||||
primary: const Color(0xff4f6272),
|
primary: const Color(0xff4f6272),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
) : Expanded(
|
) : globals.LOGGED_IN_USER.userID != 0 ? Expanded(
|
||||||
child: TextButton.icon(
|
child: TextButton.icon(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
globals.LOGGED_IN_USER.likedVenuesList.add(venue);
|
globals.LOGGED_IN_USER.likedVenuesList.add(venue);
|
||||||
|
@ -267,7 +266,42 @@ class LikeVenueButton extends StatelessWidget {
|
||||||
style: TextButton.styleFrom(
|
style: TextButton.styleFrom(
|
||||||
primary: Color(0xff4f6272),
|
primary: Color(0xff4f6272),
|
||||||
),
|
),
|
||||||
));
|
)): Expanded(
|
||||||
|
child: TextButton.icon(
|
||||||
|
onPressed: () async{
|
||||||
|
await notLoggedInError(context);
|
||||||
|
},
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.favorite_border_outlined,
|
||||||
|
color: Colors.grey,
|
||||||
|
),
|
||||||
|
label: const Text('Like place'),
|
||||||
|
style: TextButton.styleFrom(
|
||||||
|
primary: Color(0xff4f6272),
|
||||||
|
),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
notLoggedInError(BuildContext context) {
|
||||||
|
Widget okButton = TextButton(
|
||||||
|
child: Text("OK"),
|
||||||
|
onPressed: () => Navigator.pop(context, 'OK'),
|
||||||
|
);
|
||||||
|
// set up the AlertDialog
|
||||||
|
AlertDialog alert = AlertDialog(
|
||||||
|
title: Text("Can\'t like venue"),
|
||||||
|
content: Text("You need to be logged in to like venues."),
|
||||||
|
actions: [
|
||||||
|
okButton,
|
||||||
|
],
|
||||||
|
);
|
||||||
|
// show the dialog
|
||||||
|
showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (BuildContext context) {
|
||||||
|
return alert;
|
||||||
|
},
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user