diff --git a/Mobile/lib/reviewlist.dart b/Mobile/lib/reviewlist.dart index 6c21f05..9577349 100644 --- a/Mobile/lib/reviewlist.dart +++ b/Mobile/lib/reviewlist.dart @@ -2,6 +2,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:mobile/base/sidemenu.dart'; import 'models.dart'; +import 'api.dart' as api; class ReviewListPage extends StatefulWidget { const ReviewListPage({super.key}); @@ -69,6 +70,11 @@ class _ReviewListState extends State { )), floatingActionButton: FloatingActionButton( onPressed: () async { + if (!await api.isLoggedIn(context)) { + ScaffoldMessenger.of(context).showSnackBar(const SnackBar(content: Text("You must be logged in to do that"))); + return; + } + final review = await Navigator.pushNamed(context, '/create-review', arguments: place) as Review?; if (review != null) reviews.add(review); }, diff --git a/Mobile/pubspec.lock b/Mobile/pubspec.lock index a5843ce..a246c0b 100644 --- a/Mobile/pubspec.lock +++ b/Mobile/pubspec.lock @@ -308,10 +308,10 @@ packages: dependency: transitive description: name: image_picker_android - sha256: c0a6763d50b354793d0192afd0a12560b823147d3ded7c6b77daf658fa05cc85 + sha256: "8c5abf0dcc24fe6e8e0b4a5c0b51a5cf30cefdf6407a3213dae61edc75a70f56" url: "https://pub.dev" source: hosted - version: "0.8.12+13" + version: "0.8.12+12" image_picker_for_web: dependency: transitive description: @@ -742,5 +742,5 @@ packages: source: hosted version: "1.0.4" sdks: - dart: ">=3.5.0 <4.0.0" - flutter: ">=3.24.0" + dart: ">=3.4.0 <4.0.0" + flutter: ">=3.22.0"