LoginPage #60

Merged
maen0574 merged 6 commits from LoginPage into master 2022-06-01 22:50:13 +02:00
4 changed files with 39 additions and 31 deletions
Showing only changes of commit 48176cfe8e - Show all commits

File diff suppressed because one or more lines are too long

View File

@ -159,6 +159,7 @@ class MapState extends State<Map> {
body: Stack (
children: [
GoogleMap(
zoomControlsEnabled: true,
cameraTargetBounds: CameraTargetBounds(LatLngBounds(
northeast: const LatLng(59.3474696569038, 18.1001602476002147),
southwest: const LatLng(59.297332547922636, 17.999522500277884))),
@ -189,17 +190,6 @@ class MapState extends State<Map> {
// ,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,
);
}

View File

@ -29,22 +29,6 @@ class Venue {
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 &&
tempAddress != null &&
tempStreetNo != null &&

View File

@ -1,6 +1,5 @@
import 'dart:convert';
import 'dart:io';
import 'package:share_plus/share_plus.dart';
import 'package:flutter_applicationdemo/Venue.dart';
import 'package:flutter/material.dart';
@ -253,7 +252,7 @@ class LikeVenueButton extends StatelessWidget {
primary: const Color(0xff4f6272),
),
),
) : Expanded(
) : globals.LOGGED_IN_USER.userID != 0 ? Expanded(
child: TextButton.icon(
onPressed: () {
globals.LOGGED_IN_USER.likedVenuesList.add(venue);
@ -267,7 +266,42 @@ class LikeVenueButton extends StatelessWidget {
style: TextButton.styleFrom(
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;
},
);
}
}