newnewnewFeedback #38
File diff suppressed because one or more lines are too long
166
lib/Map.dart
166
lib/Map.dart
@ -1,6 +1,8 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_applicationdemo/Form.dart';
|
||||||
|
import 'package:flutter_applicationdemo/HomePage.dart';
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||||
import 'package:flutter_google_places/flutter_google_places.dart';
|
import 'package:flutter_google_places/flutter_google_places.dart';
|
||||||
@ -9,7 +11,12 @@ import 'package:google_api_headers/google_api_headers.dart';
|
|||||||
import 'package:http/http.dart' as http;
|
import 'package:http/http.dart' as http;
|
||||||
import 'package:location/location.dart';
|
import 'package:location/location.dart';
|
||||||
import 'package:geolocator/geolocator.dart';
|
import 'package:geolocator/geolocator.dart';
|
||||||
|
import 'FeedbackPage.dart';
|
||||||
import 'SettingsPage.dart';
|
import 'SettingsPage.dart';
|
||||||
|
import 'globals.dart' as globals;
|
||||||
|
import 'login/CreateAccountPage.dart';
|
||||||
|
import 'login/signInPage.dart';
|
||||||
|
import 'login/user.dart';
|
||||||
|
|
||||||
|
|
||||||
class Map extends StatefulWidget {
|
class Map extends StatefulWidget {
|
||||||
@ -313,26 +320,22 @@ class MapState extends State<Map> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
|
centerTitle: true,
|
||||||
|
title: const Text("Sun chasers"),
|
||||||
key: homeSacffoldKey,
|
key: homeSacffoldKey,
|
||||||
//leading: IconButton(icon: Icon(Icons.search), onPressed:() {},),
|
|
||||||
actions: <Widget>[
|
|
||||||
IconButton(icon: const Icon(Icons.search), onPressed:() {
|
|
||||||
},),
|
|
||||||
],
|
|
||||||
title: TextFormField(
|
|
||||||
controller: _searchController,
|
|
||||||
textCapitalization: TextCapitalization.words,
|
|
||||||
decoration: const InputDecoration(hintText: 'Find your place'),
|
|
||||||
onChanged: (value) {
|
|
||||||
print(value);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
backgroundColor: const Color.fromARGB(255, 190, 146, 160),
|
backgroundColor: const Color.fromARGB(255, 190, 146, 160),
|
||||||
),
|
),
|
||||||
|
drawer : Drawer(
|
||||||
|
child: Container(
|
||||||
|
child: globals.LOGGED_IN_USER.userID == 0 ? buildDrawerSignedOut(context) : buildDrawerSignedIn(context),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
body: Stack (
|
body: Stack (
|
||||||
children: [
|
children: [
|
||||||
GoogleMap(
|
GoogleMap(
|
||||||
mapType: MapType.normal,
|
|
||||||
|
mapType: MapType.normal,
|
||||||
initialCameraPosition: _kGooglePlex,
|
initialCameraPosition: _kGooglePlex,
|
||||||
markers: markersList.map((e) => e).toSet(),
|
markers: markersList.map((e) => e).toSet(),
|
||||||
onMapCreated: (GoogleMapController controller) {
|
onMapCreated: (GoogleMapController controller) {
|
||||||
@ -390,7 +393,7 @@ class MapState extends State<Map> {
|
|||||||
MaterialPageRoute(
|
MaterialPageRoute(
|
||||||
builder: (context) => const SettingsPage()));
|
builder: (context) => const SettingsPage()));
|
||||||
},
|
},
|
||||||
backgroundColor: Colors.purple,
|
backgroundColor: Colors.blueAccent,
|
||||||
child: const Icon(Icons.filter_alt),
|
child: const Icon(Icons.filter_alt),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -490,6 +493,139 @@ class MapState extends State<Map> {
|
|||||||
}*/
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Widget buildDrawerSignedIn(BuildContext context){
|
||||||
|
return Drawer(
|
||||||
|
child: ListView(
|
||||||
|
padding: EdgeInsets.zero,
|
||||||
|
children: [
|
||||||
|
DrawerHeader(
|
||||||
|
decoration: const BoxDecoration(color: Color.fromARGB(255, 190, 146, 160)),
|
||||||
|
child: Column(children: const <Widget>[
|
||||||
|
Text('Sun Chaser',
|
||||||
|
style :TextStyle(fontSize: 32),
|
||||||
|
),
|
||||||
|
|
||||||
|
SizedBox(height: 30),
|
||||||
|
Icon(Icons.account_box_rounded),
|
||||||
|
|
||||||
|
],
|
||||||
|
|
||||||
|
),
|
||||||
|
|
||||||
|
),
|
||||||
|
|
||||||
|
ListTile(
|
||||||
|
leading: Icon(Icons.logout),
|
||||||
|
title: Text('Sign out'),
|
||||||
|
onTap:(){
|
||||||
|
globals.LOGGED_IN_USER = user(0, "", "");
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(builder: (context) => HomePage()), //Replace Container() with call to Map-page.
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
ListTile(
|
||||||
|
leading: Icon(Icons.thumb_up_alt),
|
||||||
|
title: Text('Give feedback'),
|
||||||
|
onTap:(){
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (context) => FormForFeedback(),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
|
||||||
|
),
|
||||||
|
ListTile(
|
||||||
|
leading: Icon(Icons.settings),
|
||||||
|
title: Text('Settings'),
|
||||||
|
onTap:(){
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (context) => SettingsPage(),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget buildDrawerSignedOut(BuildContext context){
|
||||||
|
return Drawer(
|
||||||
|
child: ListView(
|
||||||
|
padding: EdgeInsets.zero,
|
||||||
|
children: [
|
||||||
|
DrawerHeader(
|
||||||
|
decoration: const BoxDecoration(color: Color.fromARGB(255, 190, 146, 160)),
|
||||||
|
child: Column(children: const <Widget>[
|
||||||
|
Text('Sun Chaser',
|
||||||
|
style :TextStyle(fontSize: 32),
|
||||||
|
),
|
||||||
|
|
||||||
|
SizedBox(height: 30),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
ListTile(
|
||||||
|
leading: Icon(Icons.account_box_rounded),
|
||||||
|
title: Text('Create account'),
|
||||||
|
onTap:(){
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (context) => CreateAccountPage(),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
ListTile(
|
||||||
|
leading: Icon(Icons.login),
|
||||||
|
title: Text('Sign in'),
|
||||||
|
onTap:(){
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (context) => SignInPage(),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},),
|
||||||
|
ListTile(
|
||||||
|
leading: Icon(Icons.thumb_up_alt),
|
||||||
|
title: Text('Give feedback'),
|
||||||
|
onTap:(){
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (context) => FormForFeedback(),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
ListTile(
|
||||||
|
leading: Icon(Icons.settings),
|
||||||
|
title: Text('Settings'),
|
||||||
|
onTap:(){
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (context) => SettingsPage(),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
class _Marker {
|
class _Marker {
|
||||||
|
|
||||||
var Plats_1;
|
var Plats_1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user