Skip to content

Commit

Permalink
main.dart UI 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Solid9966 committed May 7, 2024
2 parents 3adaa66 + 52a7c13 commit 350eab9
Show file tree
Hide file tree
Showing 5 changed files with 129 additions and 129 deletions.
2 changes: 1 addition & 1 deletion frontend/pradtice/lib/GoogleMap.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'dart:async';
import 'package:flutter/material.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'location_permission.dart';

//수정 본
class MyGoogleMap extends StatelessWidget {
@override
Widget build(BuildContext context) {
Expand Down
16 changes: 8 additions & 8 deletions frontend/pradtice/lib/location_permission.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ class MyLocation {

if (status_position.isGranted) {
// 권한이 있는 경우, 10초마다 위치 정보를 출력합니다.
Position position = await Geolocator.getCurrentPosition(desiredAccuracy: LocationAccuracy.high);
Position position = await Geolocator.getCurrentPosition(desiredAccuracy: LocationAccuracy.high);

latitude = position.latitude;
longitude = position.longitude;
latitude = position.latitude;
longitude = position.longitude;

print("위도: $latitude , 경도: $longitude");
print("위도: $latitude , 경도: $longitude");
} else {
// 권한이 없는 경우
print("위치 권한이 필요합니다.");
Expand All @@ -26,12 +26,12 @@ class MyLocation {

// 사용자가 권한을 허용한 경우
if (status_position_request.isGranted) {
Position position = await Geolocator.getCurrentPosition(desiredAccuracy: LocationAccuracy.high);
Position position = await Geolocator.getCurrentPosition(desiredAccuracy: LocationAccuracy.high);

latitude = position.latitude;
longitude = position.longitude;
latitude = position.latitude;
longitude = position.longitude;

print("위도: $latitude , 경도: $longitude");
print("위도: $latitude , 경도: $longitude");

} else {
// 사용자가 권한을 거부한 경우
Expand Down
194 changes: 97 additions & 97 deletions frontend/pradtice/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,105 +61,105 @@ class _MyHomePageState extends State<MyHomePage> {
// MaterialPageRoute(builder: (context) => SttTab()),
// );
// },
child: Scaffold(
appBar: AppBar(
backgroundColor: Colors.blueGrey,
title: Text("메인화면"),
bottom: PreferredSize(
preferredSize: Size.fromHeight(4.0), // 밑줄의 높이 설정
child: Container(
color: Colors.black, // 밑줄의 색상 설정
height: 1.0, // 밑줄의 두께 설정
child: Scaffold(
appBar: AppBar(
backgroundColor: Colors.blueGrey,
title: Text("메인화면"),
bottom: PreferredSize(
preferredSize: Size.fromHeight(4.0), // 밑줄의 높이 설정
child: Container(
color: Colors.black, // 밑줄의 색상 설정
height: 1.0, // 밑줄의 두께 설정
),
),
),
),
),

backgroundColor: Colors.blueGrey, // Scaffold의 배경색을 설정
body:Container(
color: Colors.blueGrey,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Padding(
padding: const EdgeInsets.only(bottom: 150.0), // 마이크 아이콘과 모드 버튼들 사이의 간격을 조정
child: ElevatedButton(
onPressed: (){
Navigator.push(context,
MaterialPageRoute(builder: (context) => SttTab()),
);
},
style: ElevatedButton.styleFrom(
shape: CircleBorder(), // 버튼을 원형으로 만듦
padding: EdgeInsets.all(20), // 원형 버튼 내부의 아이콘과의 padding
backgroundColor: Colors.blueGrey, // Scaffold의 배경색을 설정
body:Container(
color: Colors.blueGrey,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Padding(
padding: const EdgeInsets.only(bottom: 150.0), // 마이크 아이콘과 모드 버튼들 사이의 간격을 조정
child: ElevatedButton(
onPressed: (){
Navigator.push(context,
MaterialPageRoute(builder: (context) => SttTab()),
);
},
style: ElevatedButton.styleFrom(
shape: CircleBorder(), // 버튼을 원형으로 만듦
padding: EdgeInsets.all(20), // 원형 버튼 내부의 아이콘과의 padding
),
child: Icon(Icons.mic, size: 40.0,color: Colors.blueGrey,), // 아이콘 크기를 조정하여 화면 비중 감소
),
child: Icon(Icons.mic, size: 40.0,color: Colors.blueGrey,), // 아이콘 크기를 조정하여 화면 비중 감소
),
),
Center(
child: Wrap( // ButtonBar 대신 Wrap 위젯을 사용하여 모드 버튼들을 더 유연하게 배치
spacing: 70.0, // 가로 간격
runSpacing: 50.0, // 세로 간격
alignment: WrapAlignment.center,
children: <Widget>[
ElevatedButton(
onPressed: () {
Navigator.push(context,
MaterialPageRoute(builder: (context) => ObjectReco()),
);
},
style: ElevatedButton.styleFrom(
minimumSize: Size(MediaQuery.of(context).size.width * 0.4, 50),
// backgroundColor: Colors.,
foregroundColor: Colors.blueGrey,
Center(
child: Wrap( // ButtonBar 대신 Wrap 위젯을 사용하여 모드 버튼들을 더 유연하게 배치
spacing: 70.0, // 가로 간격
runSpacing: 50.0, // 세로 간격
alignment: WrapAlignment.center,
children: <Widget>[
ElevatedButton(
onPressed: () {
Navigator.push(context,
MaterialPageRoute(builder: (context) => ObjectReco()),
);
},
style: ElevatedButton.styleFrom(
minimumSize: Size(MediaQuery.of(context).size.width * 0.4, 50),
// backgroundColor: Colors.,
foregroundColor: Colors.blueGrey,

),
child: Text('보행 모드', style: TextStyle(fontWeight: FontWeight.w700, fontSize: 20)),
),
child: Text('보행 모드', style: TextStyle(fontWeight: FontWeight.w700, fontSize: 20)),
),
ElevatedButton(
onPressed: () {
Navigator.push(context,
MaterialPageRoute(builder: (context) => NaviTap()),
);
},
style: ElevatedButton.styleFrom(
minimumSize: Size(MediaQuery.of(context).size.width * 0.4, 50),
// backgroundColor: Colors.,
foregroundColor: Colors.blueGrey,
ElevatedButton(
onPressed: () {
Navigator.push(context,
MaterialPageRoute(builder: (context) => NaviTap()),
);
},
style: ElevatedButton.styleFrom(
minimumSize: Size(MediaQuery.of(context).size.width * 0.4, 50),
// backgroundColor: Colors.,
foregroundColor: Colors.blueGrey,

),
child: Text('내비게이션 모드', style: TextStyle(fontWeight: FontWeight.w700, fontSize: 20)),
),
child: Text('내비게이션 모드', style: TextStyle(fontWeight: FontWeight.w700, fontSize: 20)),
),

// TextButton(onPressed: (){
// setState(() {
// sever.start_navi();
// });
// }, child: Text('경로안내 시작')),
// TextButton(onPressed: (){
// setState(() {
// sever.current_location();
// });
// }, child: Text('경로 안내')),
// TextButton(onPressed: (){
// setState(() {
// sever.cancel_navi();
// });
// }, child: Text('경로 종료')),
// Text(sever.description),
// Text(sever.distance+'M'),
// Text('IdxNode : ${sever.IdxNode}')
// TextButton(onPressed: (){
// setState(() {
// sever.start_navi();
// });
// }, child: Text('경로안내 시작')),
// TextButton(onPressed: (){
// setState(() {
// sever.current_location();
// });
// }, child: Text('경로 안내')),
// TextButton(onPressed: (){
// setState(() {
// sever.cancel_navi();
// });
// }, child: Text('경로 종료')),
// Text(sever.description),
// Text(sever.distance+'M'),
// Text('IdxNode : ${sever.IdxNode}')

],
),
)
],
),
)
],
),
)
],
),
)



),
),
);
}
}
Expand Down Expand Up @@ -247,7 +247,7 @@ class _SttTabState extends State<SttTab> {
_startListening();
}
}, icon: Icon(Icons.mic,size:50),style: IconButton.styleFrom(
fixedSize: Size(200,70)
fixedSize: Size(200,70)
),),
],

Expand All @@ -264,11 +264,11 @@ class _SttTabState extends State<SttTab> {
);
}
else if (_lastWords == '경로 탐색 모드') {
Navigator.pop(context);
Navigator.push(
context,
MaterialPageRoute(builder: (context) => MyGoogleMap())
);
Navigator.pop(context);
Navigator.push(
context,
MaterialPageRoute(builder: (context) => MyGoogleMap())
);
} else if(_lastWords == '즐겨찾기 모드') {
Navigator.pop(context);
Navigator.push(
Expand All @@ -277,11 +277,11 @@ class _SttTabState extends State<SttTab> {
);
}
else if (_lastWords == '편의 모드') {
Navigator.pop(context);
Navigator.push(
context,
MaterialPageRoute(builder: (context) => ConvenienceMode()),
);
Navigator.pop(context);
Navigator.push(
context,
MaterialPageRoute(builder: (context) => ConvenienceMode()),
);
} else{
Navigator.pop(context);
}
Expand Down
26 changes: 13 additions & 13 deletions frontend/pradtice/lib/sever.dart
Original file line number Diff line number Diff line change
Expand Up @@ -181,16 +181,16 @@ class _testmapState extends State<testmap> {
void _centerloca(LatLng posi){
setState(() {
_center = CameraPosition(
target: posi,
zoom: 14
target: posi,
zoom: 14
);
});
}
void nodeloca(LatLng posi){
setState(() {
nodeloc = CameraPosition(
target:posi,
zoom: 14
target:posi,
zoom: 14
);
});
}
Expand All @@ -199,20 +199,20 @@ class _testmapState extends State<testmap> {
zoom: 14
);
CameraPosition nodeloc = CameraPosition(
target: LatLng(37.5665, 126.9780),
zoom: 14
target: LatLng(37.5665, 126.9780),
zoom: 14
);
@override
Widget build(BuildContext context) {
return Scaffold(
body: GoogleMap(myLocationEnabled: true,
initialCameraPosition: _center,
markers: {
Marker(
markerId: MarkerId('IdxNode : ${sever.IdxNode}'),
position: LatLng(double.parse(sever.nodeLat),double.parse(sever.nodeLon))
)
}
initialCameraPosition: _center,
markers: {
Marker(
markerId: MarkerId('IdxNode : ${sever.IdxNode}'),
position: LatLng(double.parse(sever.nodeLat),double.parse(sever.nodeLon))
)
}
),
);
}
Expand Down
20 changes: 10 additions & 10 deletions frontend/pradtice/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ dependencies:
# 로드 되어있는 flutter_vision-master 경로로 설정!
path: C:\Users\User\Desktop\capstone-5.7R\frontend\flutter_vision-master

# tmap_ui_sdk:
# git:
# url: https://github.com/TmapSDK/TmapUI_FlutterSDK.git
# ref: 1.0.26 # version. git tag name
# tmap_ui_sdk:
# git:
# url: https://github.com/TmapSDK/TmapUI_FlutterSDK.git
# ref: 1.0.26 # version. git tag name

http: ^0.13.4
test: ^1.24.9
Expand All @@ -63,11 +63,11 @@ dev_dependencies:
flutter_test:
sdk: flutter

# camera:
# git:
# url: https://github.com/flutter/plugins
# path: packages/camera/camera
# ref: 9e46048ad2e1f085c1e8f6c77391fa52025e681f
# camera:
# git:
# url: https://github.com/flutter/plugins
# path: packages/camera/camera
# ref: 9e46048ad2e1f085c1e8f6c77391fa52025e681f

tflite_flutter: ^0.9.1
tflite_flutter_helper: ^0.2.1
Expand Down Expand Up @@ -97,7 +97,7 @@ flutter:
- assets/labels.txt
- assets/yolov5n.tflite
- assets/tessdata/
# - assets/best-fp16.tflite # 이후 객체 인식 커스터마이징 사용시에 사용
# - assets/best-fp16.tflite # 이후 객체 인식 커스터마이징 사용시에 사용

# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware
Expand Down

0 comments on commit 350eab9

Please sign in to comment.