Venues from server #44

Merged
adsu7578 merged 5 commits from venue-page into master 2022-05-26 11:23:12 +02:00
Showing only changes of commit 9f359b944e - Show all commits

View File

@ -27,14 +27,13 @@ import 'globals.dart' as globals;
import 'package:syncfusion_flutter_sliders/sliders.dart'; import 'package:syncfusion_flutter_sliders/sliders.dart';
import 'globals.dart' as globals; import 'globals.dart' as globals;
======= import 'HomePage.dart';
import 'SettingsPage.dart'; import 'SettingsPage.dart';
import 'Venue.dart'; import 'Venue.dart';
import 'globals.dart' as globals; import 'globals.dart' as globals;
import 'FeedbackPage.dart'; import 'FeedbackPage.dart';
import 'login/CreateAccountPage.dart'; import 'login/CreateAccountPage.dart';
import 'login/signInPage.dart'; import 'login/signInPage.dart';
>>>>>>> master
class Map extends StatefulWidget { class Map extends StatefulWidget {
@override @override
@ -175,26 +174,24 @@ class MapState extends State<Map> {
title: const Text("Sun chasers"), title: const Text("Sun chasers"),
key: homeSacffoldKey, key: homeSacffoldKey,
//leading: IconButton(icon: Icon(Icons.search), onPressed:() {},), //leading: IconButton(icon: Icon(Icons.search), onPressed:() {},),
actions: <Widget>[ /*actions: <Widget>[
IconButton( IconButton(
icon: const Icon(Icons.search), icon: const Icon(Icons.search),
onPressed: () {}, onPressed: () {},
), ),
], ],*/
title: TextFormField( /*title: TextFormField(
controller: _searchController, controller: _searchController,
textCapitalization: TextCapitalization.words, textCapitalization: TextCapitalization.words,
decoration: const InputDecoration(hintText: 'Find your place'), decoration: const InputDecoration(hintText: 'Find your place'),
onChanged: (value) { onChanged: (value) {
print(value); print(value);
}, },
), ),*/
<<<<<<< HEAD
actions: <Widget>[createFilterMenuButton()], actions: <Widget>[createFilterMenuButton()],
backgroundColor: const Color.fromARGB(255, 190, 146, 160), backgroundColor: const Color.fromARGB(255, 190, 146, 160),
), ),
body: Stack( /*body: Stack(
=======
backgroundColor: const Color.fromARGB(255, 190, 146, 160), backgroundColor: const Color.fromARGB(255, 190, 146, 160),
), ),
body: Stack( body: Stack(
@ -202,10 +199,9 @@ class MapState extends State<Map> {
child: Container( child: Container(
child: globals.LOGGED_IN_USER.userID == 0 ? buildDrawerSignedOut(context) : buildDrawerSignedIn(context), child: globals.LOGGED_IN_USER.userID == 0 ? buildDrawerSignedOut(context) : buildDrawerSignedIn(context),
), ),
), ),*/
body: Stack ( body: Stack(
>>>>>>> master
children: [ children: [
GoogleMap( GoogleMap(
mapType: MapType.normal, mapType: MapType.normal,
@ -226,10 +222,18 @@ class MapState extends State<Map> {
floatingActionButton: Padding( floatingActionButton: Padding(
padding: const EdgeInsets.only(top: 100.0), padding: const EdgeInsets.only(top: 100.0),
child: FloatingActionButton( child: FloatingActionButton(
onPressed: () {
Navigator.push(context,
MaterialPageRoute(builder: (context) => const SettingsPage()));
},
backgroundColor: Colors.purple,
child: const Icon(Icons.filter_alt),
),
),
floatingActionButtonLocation: FloatingActionButtonLocation.endTop,
); );
} }
<<<<<<< HEAD
PopupMenuButton<dynamic> createFilterMenuButton() { PopupMenuButton<dynamic> createFilterMenuButton() {
return PopupMenuButton( return PopupMenuButton(
icon: Icon(Icons.filter_list), icon: Icon(Icons.filter_list),
@ -250,10 +254,9 @@ class MapState extends State<Map> {
child: ButtonBar( child: ButtonBar(
alignment: MainAxisAlignment.center, alignment: MainAxisAlignment.center,
children: [ children: [
ElevatedButton( ElevatedButton(
onPressed: onPressed: null,
null, // TODO: Fixa att kartan filtreras när man klickar 'Apply Filters' // TODO: Fixa att kartan filtreras när man klickar 'Apply Filters'
child: Text( child: Text(
"Apply Filters", "Apply Filters",
style: TextStyle(color: Colors.black), style: TextStyle(color: Colors.black),
@ -270,72 +273,76 @@ class MapState extends State<Map> {
// Creates the checkboxes for the filter menu // Creates the checkboxes for the filter menu
PopupMenuItem<dynamic> createCheckBoxes() { PopupMenuItem<dynamic> createCheckBoxes() {
return PopupMenuItem( return PopupMenuItem(
child: Padding( child: Padding(
padding: const EdgeInsets.all(8), padding: const EdgeInsets.all(8),
child: Expanded( child: Expanded(
child: Column( child: Column(
children: [
children: [ Divider(
Divider(color: Colors.black,), color: Colors.black,
StatefulBuilder(
builder: (BuildContext context, StateSetter setState) {
return CheckboxListTile(
value: _barFilterValue,
onChanged: (bool? newValue) {
setState(() {
_barFilterValue = newValue;
});
},
title: const Icon(
Icons.sports_bar,
color: Colors.orange,
));
}),
StatefulBuilder(
builder: (BuildContext context, StateSetter setState) {
return CheckboxListTile(
value: _restaurantFilterValue,
onChanged: (bool? newValue) {
setState(() {
_restaurantFilterValue = newValue;
});
},
title: Icon(
Icons.restaurant,
color: Colors.blueGrey[200],
), ),
); StatefulBuilder(
}), builder: (BuildContext context, StateSetter setState) {
//Cafe checkbox return CheckboxListTile(
value: _barFilterValue,
onChanged: (bool? newValue) {
setState(() {
_barFilterValue = newValue;
});
},
title: const Icon(
Icons.sports_bar,
color: Colors.orange,
));
}),
StatefulBuilder(
builder: (BuildContext context, StateSetter setState) {
return CheckboxListTile(
value: _restaurantFilterValue,
onChanged: (bool? newValue) {
setState(() {
_restaurantFilterValue = newValue;
});
},
title: Icon(
Icons.restaurant,
color: Colors.blueGrey[200],
),
);
}),
//Cafe checkbox
StatefulBuilder( StatefulBuilder(
builder: (BuildContext context, StateSetter setState) { builder: (BuildContext context, StateSetter setState) {
return CheckboxListTile( return CheckboxListTile(
value: _cafeFilterValue, value: _cafeFilterValue,
onChanged: (bool? newValue) { onChanged: (bool? newValue) {
setState(() => _cafeFilterValue = newValue); setState(() => _cafeFilterValue = newValue);
}, },
title: Icon( title: Icon(
Icons.coffee, Icons.coffee,
color: Colors.brown[400], color: Colors.brown[400],
)); ));
}), }),
],
], /*floatingActionButton: Padding(
======= padding: const EdgeInsets.only(top: 100.0),
floatingActionButton: Padding( child: FloatingActionButton(
padding: const EdgeInsets.only(top: 100.0), onPressed: () {
child: FloatingActionButton( Navigator.push(
onPressed: () { context,
Navigator.push(context, MaterialPageRoute(
MaterialPageRoute(builder: (context) => const SettingsPage())); builder: (context) => const SettingsPage()));
}, },
backgroundColor: Colors.purple, backgroundColor: Colors.purple,
child: const Icon(Icons.filter_alt), child: const Icon(Icons.filter_alt),
), ),
), ),
floatingActionButtonLocation: FloatingActionButtonLocation.endTop, floatingActionButtonLocation: FloatingActionButtonLocation
); .endTop,*/
),
)));
} }
PopupMenuItem<dynamic> createPriceSlider() { PopupMenuItem<dynamic> createPriceSlider() {
@ -502,10 +509,8 @@ class MapState extends State<Map> {
ElevatedButton( ElevatedButton(
child: const Text('ListView'), child: const Text('ListView'),
onPressed: () { onPressed: () {
Navigator.push( Navigator.push(context,
context, MaterialPageRoute(builder: (context) => ListViewPage()));
MaterialPageRoute(
builder: (context) => ListViewPage()));
}, },
), ),
], ],
@ -603,45 +608,43 @@ class MapState extends State<Map> {
googleMapController.animateCamera(CameraUpdate.newLatLngZoom(LatLng(lat,lng), 14.0)); googleMapController.animateCamera(CameraUpdate.newLatLngZoom(LatLng(lat,lng), 14.0));
}*/ }*/
} }
<<<<<<< HEAD
=======
Widget buildDrawerSignedIn(BuildContext context){ Widget buildDrawerSignedIn(BuildContext context) {
return Drawer( return Drawer(
child: ListView( child: ListView(
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
children: [ children: [
DrawerHeader( DrawerHeader(
decoration: const BoxDecoration(color: Color.fromARGB(255, 190, 146, 160)), decoration:
child: Column(children: const <Widget>[ const BoxDecoration(color: Color.fromARGB(255, 190, 146, 160)),
Text('Sun Chaser', child: Column(
style :TextStyle(fontSize: 32), children: const <Widget>[
), Text(
'Sun Chaser',
SizedBox(height: 30), style: TextStyle(fontSize: 32),
Icon(Icons.account_box_rounded), ),
SizedBox(height: 30),
], Icon(Icons.account_box_rounded),
],
), ),
), ),
ListTile( ListTile(
leading: Icon(Icons.logout), leading: Icon(Icons.logout),
title: Text('Sign out'), title: Text('Sign out'),
onTap:(){ onTap: () {
globals.LOGGED_IN_USER = User(0, "", ""); globals.LOGGED_IN_USER = User(0, "", "");
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute(builder: (context) => HomePage()), //Replace Container() with call to Map-page. MaterialPageRoute(
builder: (context) =>
HomePage()), //Replace Container() with call to Map-page.
); );
}, },
), ),
ListTile( ListTile(
leading: Icon(Icons.thumb_up_alt), leading: Icon(Icons.thumb_up_alt),
title: Text('Give feedback'), title: Text('Give feedback'),
onTap:(){ onTap: () {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
@ -649,12 +652,11 @@ Widget buildDrawerSignedIn(BuildContext context){
), ),
); );
}, },
), ),
ListTile( ListTile(
leading: Icon(Icons.settings), leading: Icon(Icons.settings),
title: Text('Settings'), title: Text('Settings'),
onTap:(){ onTap: () {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
@ -663,33 +665,33 @@ Widget buildDrawerSignedIn(BuildContext context){
); );
}, },
), ),
], ],
), ),
); );
} }
Widget buildDrawerSignedOut(BuildContext context){ Widget buildDrawerSignedOut(BuildContext context) {
return Drawer( return Drawer(
child: ListView( child: ListView(
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
children: [ children: [
DrawerHeader( DrawerHeader(
decoration: const BoxDecoration(color: Color.fromARGB(255, 190, 146, 160)), decoration:
child: Column(children: const <Widget>[ const BoxDecoration(color: Color.fromARGB(255, 190, 146, 160)),
Text('Sun Chaser', child: Column(
style :TextStyle(fontSize: 32), children: const <Widget>[
), Text(
'Sun Chaser',
SizedBox(height: 30), style: TextStyle(fontSize: 32),
], ),
SizedBox(height: 30),
],
), ),
), ),
ListTile( ListTile(
leading: Icon(Icons.account_box_rounded), leading: Icon(Icons.account_box_rounded),
title: Text('Create account'), title: Text('Create account'),
onTap:(){ onTap: () {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
@ -697,22 +699,23 @@ Widget buildDrawerSignedOut(BuildContext context){
), ),
); );
}, },
), ),
ListTile( ListTile(
leading: Icon(Icons.login), leading: Icon(Icons.login),
title: Text('Sign in'), title: Text('Sign in'),
onTap:(){ onTap: () {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => SignInPage(), builder: (context) => SignInPage(),
), ),
); );
},), },
),
ListTile( ListTile(
leading: Icon(Icons.thumb_up_alt), leading: Icon(Icons.thumb_up_alt),
title: Text('Give feedback'), title: Text('Give feedback'),
onTap:(){ onTap: () {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
@ -724,7 +727,7 @@ Widget buildDrawerSignedOut(BuildContext context){
ListTile( ListTile(
leading: Icon(Icons.settings), leading: Icon(Icons.settings),
title: Text('Settings'), title: Text('Settings'),
onTap:(){ onTap: () {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
@ -738,14 +741,10 @@ Widget buildDrawerSignedOut(BuildContext context){
); );
} }
class _Marker { class _Marker {
var Plats_1; var Plats_1;
var Gatunr_1; var Gatunr_1;
var coordinates; var coordinates;
_Marker(this.Plats_1, this.Gatunr_1, this.coordinates); _Marker(this.Plats_1, this.Gatunr_1, this.coordinates);
} }
>>>>>>> master