Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
fix some bugs
  • Loading branch information
angeloskanatas authored Mar 5, 2023
1 parent 81fc873 commit 761f0af
Show file tree
Hide file tree
Showing 5 changed files with 129 additions and 64 deletions.
178 changes: 120 additions & 58 deletions lib/map.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
// ignore_for_file: library_private_types_in_public_api

import 'dart:ui';

import 'package:flutter/material.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';

import 'homepage.dart';
import 'myprofile.dart';
import 'settings.dart';

class MapPage extends StatefulWidget {
const MapPage({Key? key}) : super(key: key);

Expand All @@ -29,7 +35,7 @@ class _MapPageState extends State<MapPage> {
'name': 'Retiré at the ERGON House',
'latitude': 37.97535010321253,
'longitude': 23.73171933556687,
'description': 'Medita'
'description': ' A food market, café & restaurant completed with a foodie boutique hotel. A seventh heaven for food enthusiasts.'
},
{
'name': 'Birdman - Japanese Pub + Grill',
Expand All @@ -50,67 +56,123 @@ class _MapPageState extends State<MapPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: SingleChildScrollView(
physics: const NeverScrollableScrollPhysics(),
child: Column(
children: [
SizedBox(
height: MediaQuery.of(context).size.height * 0.6,
child: GoogleMap(
initialCameraPosition: CameraPosition(
target: initialLocation,
zoom: 15,
),
onMapCreated: (GoogleMapController controller) {
mapController = controller;
},
markers: _markers,
),
appBar: AppBar(
backgroundColor: Colors.transparent,
bottomOpacity: 0.0,
elevation: 0.0,
leading: IconButton(
icon: const Icon(Icons.settings),
color: Colors.black,
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => const SettingsPage()),
);
},
),
centerTitle: true,
title: GestureDetector(
onTap: () {
Navigator.pushAndRemoveUntil(
context,
MaterialPageRoute(builder: (context) => const HomePage()),
(Route<dynamic> route) => false,
);
},
child: const Text(
'Hangify',
style: TextStyle(
color: Colors.black,
fontFamily: 'mySofia',
fontWeight: FontWeight.w400,
fontSize: 25,
letterSpacing: 0.01,
fontFeatures: [
FontFeature.enable('pnum'),
FontFeature.enable('lnum')
],
),
SizedBox(
height: MediaQuery.of(context).size.height * 0.4,
child: ListView.builder(
shrinkWrap: true,
itemCount:
locations.length, // use the length of the locations list
itemBuilder: (BuildContext context, int index) {
return ListTile(
leading: const Icon(Icons.location_on),
title: Text(locations[index]['name']),
subtitle: Text(locations[index]['description']),
onTap: () {
// add the corresponding marker to the map when a search result is tapped
setState(() {
_markers.add(
Marker(
markerId: MarkerId(locations[index]['name']),
position: LatLng(
locations[index]['latitude'],
locations[index]['longitude'],
),
infoWindow: InfoWindow(
title: locations[index]['name'],
),
),
);
});
// move the camera to the selected marker
mapController.animateCamera(
CameraUpdate.newLatLng(
LatLng(
locations[index]['latitude'],
locations[index]['longitude'],
),
),
);
},
),
),
actions: [
IconButton(
icon: const Icon(Icons.person),
color: Colors.black,
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => const MyProfilePage()),
);
},
),
],
),
body: SafeArea(
child: Column(
children: [
SizedBox(
height: MediaQuery.of(context).size.height * 0.6,
child: GoogleMap(
initialCameraPosition: CameraPosition(
target: initialLocation,
zoom: 15,
),
onMapCreated: (GoogleMapController controller) {
mapController = controller;
},
markers: _markers,
),
),
const Text(
'Search Results',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
color: Color(0xff6750A4),
),
),
Expanded(
child: ListView.builder(
shrinkWrap: true,
itemCount: locations.length,
itemBuilder: (BuildContext context, int index) {
return ListTile(
leading: const Icon(Icons.location_on, color: Color(0xff6750A4)),
title: Text(locations[index]['name']),
subtitle: Text(locations[index]['description']),
onTap: () {
setState(() {
_markers.add(
Marker(
markerId: MarkerId(locations[index]['name']),
position: LatLng(
locations[index]['latitude'],
locations[index]['longitude'],
),
infoWindow: InfoWindow(
title: locations[index]['name'],
),
),
);
},
),
),
],
});
mapController.animateCamera(
CameraUpdate.newLatLng(
LatLng(
locations[index]['latitude'],
locations[index]['longitude'],
),
),
);
},
);
},
),
),
],
),
),


);
}
}
5 changes: 3 additions & 2 deletions lib/myprofile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,11 @@ class _MyProfilePageState extends State<MyProfilePage> {
),
),
const SizedBox(width: 5.0, height: 50.0),
const Column(
Column(
crossAxisAlignment: CrossAxisAlignment.start,
// ignore: prefer_const_literals_to_create_immutables
children: [
Text(
const Text(
'Aggelos Ui/Ux',
style: TextStyle(
fontWeight: FontWeight.bold,
Expand Down
5 changes: 3 additions & 2 deletions lib/othersprofile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,11 @@ class _OthersProfilePageState extends State<OthersProfilePage> {
),
),
const SizedBox(width: 5.0, height: 50.0),
const Column(
Column(
crossAxisAlignment: CrossAxisAlignment.start,
// ignore: prefer_const_literals_to_create_immutables
children: [
Text(
const Text(
'Johnis',
style: TextStyle(
fontWeight: FontWeight.bold,
Expand Down
1 change: 1 addition & 0 deletions lib/search.dart
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ class _SearchPageState extends State<SearchPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
resizeToAvoidBottomInset: false,
appBar: AppBar(
backgroundColor: Colors.transparent,
bottomOpacity: 0.0,
Expand Down
4 changes: 2 additions & 2 deletions lib/upload.dart
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,10 @@ class _UploadPageState extends State<UploadPage> {
child: SingleChildScrollView(
padding: const EdgeInsets.all(16),
child: Column(children: [
const Row(
Row(
// ignore: prefer_const_literals_to_create_immutables
children: [
Text(
const Text(
'New post',
style: TextStyle(
fontSize: 20,
Expand Down

0 comments on commit 761f0af

Please sign in to comment.