Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: 장소 정보 페이지 생성 #12

Merged
merged 7 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added assets/images/place_example.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/png/bike.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/png/call.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/png/clock.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/png/filled_heart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/png/share.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/png/startpoint.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/png/unfilled_heart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
225 changes: 113 additions & 112 deletions lib/components/my_botton_navigation_bar.dart
Original file line number Diff line number Diff line change
@@ -1,112 +1,113 @@
import 'package:flutter/material.dart';
import 'package:mapsee/pages/search_filter_page.dart';
import 'package:mapsee/pages/home_page.dart';
import 'package:mapsee/pages/search_page.dart';
import 'package:mapsee/pages/search_page2.dart';
import 'package:mapsee/pages/search_result_page.dart';
import 'package:mapsee/pages/feed_page.dart'; // 추가: FeedPage import

class MyBottomNavigationBar extends StatefulWidget {
const MyBottomNavigationBar({super.key});

@override
_MyBottomNavigationBarState createState() => _MyBottomNavigationBarState();
}

class _MyBottomNavigationBarState extends State<MyBottomNavigationBar> {
int _currentIndex = 0;

@override
Widget build(BuildContext context) {
return BottomNavigationBar(
currentIndex: _currentIndex,
selectedItemColor: Theme.of(context).colorScheme.primary,
unselectedItemColor: Theme.of(context).colorScheme.secondary,
type: BottomNavigationBarType.fixed,
onTap: (int idx) {
setState(() {
_currentIndex = idx;
});

switch (idx) {
case 0:
Navigator.push(
context,
MaterialPageRoute(builder: (context) => const HomePage()),
);
break;
case 1:
Navigator.push(
context,
MaterialPageRoute(builder: (context) => const SearchResultPage()),
);
break;
case 2:
Navigator.push(
context,
MaterialPageRoute(builder: (context) => const SearchPage()),
);
break;
case 3:
Navigator.push(
context,
MaterialPageRoute(builder: (context) => FeedPage()), // FeedPage로 변경
);
break;
case 4:
Navigator.push(
context,
MaterialPageRoute(builder: (context) => SearchPage2()),
);
break;
}
},
items: [
BottomNavigationBarItem(
icon: Image.asset(
'assets/images/png/home.png',
color: _currentIndex == 0
? Theme.of(context).colorScheme.primary
: Theme.of(context).colorScheme.secondary,
width: 20,
),
label: 'Home',
),
const BottomNavigationBarItem(
icon: Icon(Icons.route),
label: 'Route',
),
BottomNavigationBarItem(
icon: Image.asset(
'assets/images/png/star.png',
color: _currentIndex == 2
? Theme.of(context).colorScheme.primary
: Theme.of(context).colorScheme.secondary,
width: 20,
),
label: 'Favorites',
),
BottomNavigationBarItem(
icon: Image.asset(
'assets/images/png/world.png',
color: _currentIndex == 3
? Theme.of(context).colorScheme.primary
: Theme.of(context).colorScheme.secondary,
width: 20,
),
label: 'Feed',
),
BottomNavigationBarItem(
icon: Image.asset(
'assets/images/png/user.png',
color: _currentIndex == 4
? Theme.of(context).colorScheme.primary
: Theme.of(context).colorScheme.secondary,
width: 20,
),
label: 'Profile',
),
],
);
}
}
import 'package:flutter/material.dart';
import 'package:mapsee/pages/search_filter_page.dart';
import 'package:mapsee/pages/home_page.dart';
import 'package:mapsee/pages/search_page.dart';
import 'package:mapsee/pages/search_page2.dart';
import 'package:mapsee/pages/search_result_page.dart';
import 'package:mapsee/pages/feed_page.dart'; // 추가: FeedPage import

class MyBottomNavigationBar extends StatefulWidget {
const MyBottomNavigationBar({super.key});

@override
_MyBottomNavigationBarState createState() => _MyBottomNavigationBarState();
}

class _MyBottomNavigationBarState extends State<MyBottomNavigationBar> {
int _currentIndex = 0;

@override
Widget build(BuildContext context) {
return BottomNavigationBar(
currentIndex: _currentIndex,
selectedItemColor: Theme.of(context).colorScheme.primary,
unselectedItemColor: Theme.of(context).colorScheme.secondary,
type: BottomNavigationBarType.fixed,
onTap: (int idx) {
setState(() {
_currentIndex = idx;
});

switch (idx) {
case 0:
Navigator.push(
context,
MaterialPageRoute(builder: (context) => const HomePage()),
);
break;
case 1:
Navigator.push(
context,
MaterialPageRoute(builder: (context) => const SearchResultPage()),
);
break;
case 2:
Navigator.push(
context,
MaterialPageRoute(builder: (context) => const SearchPage()),
);
break;
case 3:
Navigator.push(
context,
MaterialPageRoute(builder: (context) => FeedPage()), // FeedPage로 변경
);
break;
case 4:
Navigator.push(
context,
MaterialPageRoute(builder: (context) => SearchPage2()),
);
break;
}
},
items: [
BottomNavigationBarItem(
icon: Image.asset(
'assets/images/png/home.png',
color: _currentIndex == 0
? Theme.of(context).colorScheme.primary
: Theme.of(context).colorScheme.secondary,
width: 20,
),
label: 'Home',
),
const BottomNavigationBarItem(
icon: Icon(Icons.route),
label: 'Route',
),
BottomNavigationBarItem(
icon: Image.asset(
'assets/images/png/star.png',
color: _currentIndex == 2
? Theme.of(context).colorScheme.primary
: Theme.of(context).colorScheme.secondary,
width: 20,
),
label: 'Favorites',
),
BottomNavigationBarItem(
icon: Image.asset(
'assets/images/png/world.png',
color: _currentIndex == 3
? Theme.of(context).colorScheme.primary
: Theme.of(context).colorScheme.secondary,
width: 20,
),
label: 'Feed',
),
BottomNavigationBarItem(
icon: Image.asset(
'assets/images/png/user.png',
color: _currentIndex == 4
? Theme.of(context).colorScheme.primary
: Theme.of(context).colorScheme.secondary,
width: 20,
),
label: 'Profile',
),
],
);
}
}

81 changes: 81 additions & 0 deletions lib/components/my_departure_and_arrival_buttons.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
import 'package:flutter/material.dart';

class MyDepartureAndArrivalButtons extends StatefulWidget {
const MyDepartureAndArrivalButtons({super.key});

@override
State<MyDepartureAndArrivalButtons> createState() => _MyDepartureAndArrivalButtonsState();
}

class _MyDepartureAndArrivalButtonsState extends State<MyDepartureAndArrivalButtons> {
@override
Widget build(BuildContext context) {
return Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
GestureDetector(
onTap: () => {},
child: Container(
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.background,
borderRadius: BorderRadius.circular(15),
border: Border.all(
color: Theme.of(context).colorScheme.secondary)),
padding: const EdgeInsets.all(15),
margin: const EdgeInsets.symmetric(horizontal: 0),
child: Center(
child: Row(
children: [
Image.asset(
'assets/images/png/startpoint.png',
width: 15,
color: Theme.of(context).colorScheme.secondary,
),
SizedBox(
width: 10,
),
Text(
'출발',
style: TextStyle(
color: Theme.of(context).colorScheme.secondary),
),
],
),
)),
),
SizedBox(
width: 10,
),
GestureDetector(
onTap: () => {},
child: Container(
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.secondary,
borderRadius: BorderRadius.circular(15),
),
padding: const EdgeInsets.all(15),
margin: const EdgeInsets.symmetric(horizontal: 0),
child: Center(
child: Row(
children: [
Image.asset(
'assets/images/png/marker.png',
width: 15,
color: Theme.of(context).colorScheme.background,
),
SizedBox(
width: 10,
),
Text(
'도착',
style: TextStyle(
color: Theme.of(context).colorScheme.background),
),
],
),
)),
),
],
);
}
}
2 changes: 1 addition & 1 deletion lib/components/my_public_trans_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class _MyPublicTransButtonState extends State<MyPublicTransButton> {
_buildTransportButton(
context, 'assets/images/png/walk.png', 'walk'),
_buildTransportButton(
context, 'assets/images/png/bicycle.png', 'bicycle'),
context, 'assets/images/png/bike.png', 'bike'),
],
),
),
Expand Down
6 changes: 5 additions & 1 deletion lib/components/my_search_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ import 'package:permission_handler/permission_handler.dart';
class MySearchBar extends StatefulWidget {
final String hintText;
final TextEditingController controller;
final ValueChanged<String> onChanged;
final ValueChanged<String> onSubmitted;

const MySearchBar({
super.key,
required this.hintText,
required this.controller,
required this.onChanged,
required this.onSubmitted,
});

Expand Down Expand Up @@ -66,6 +68,7 @@ class _MySearchBarState extends State<MySearchBar> {
setState(() {
_ttsText = result.recognizedWords;
widget.controller.text = _ttsText;
widget.onChanged(_ttsText);
});
}

Expand All @@ -76,6 +79,8 @@ class _MySearchBarState extends State<MySearchBar> {
child: TextField(
controller: widget.controller,
enabled: true,
onChanged: widget.onChanged,
onSubmitted: widget.onSubmitted,
decoration: InputDecoration(
fillColor: Theme.of(context).colorScheme.background,
filled: true,
Expand Down Expand Up @@ -103,7 +108,6 @@ class _MySearchBarState extends State<MySearchBar> {
},
),
),
onSubmitted: widget.onSubmitted,
),
);
}
Expand Down
5 changes: 3 additions & 2 deletions lib/components/my_vertical_divider.dart
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import 'package:flutter/material.dart';

class MyVerticalDivider extends StatelessWidget {
const MyVerticalDivider({super.key});
final double height;
const MyVerticalDivider({super.key, required this.height});

@override
Widget build(BuildContext context) {
double screenHeight = MediaQuery.of(context).size.height;
return Container(
width: 1,
height: screenHeight * 0.02,
height: screenHeight * height,
color: Colors.grey,
margin: EdgeInsets.symmetric(horizontal: 5.0),
);
Expand Down
Loading