Skip to content

Commit

Permalink
Merge pull request #2 from Brian0KIM/uxImproving
Browse files Browse the repository at this point in the history
Ux improving
  • Loading branch information
Brian0KIM authored Dec 4, 2024
2 parents 070f9e6 + be93644 commit f73ee31
Show file tree
Hide file tree
Showing 14 changed files with 678 additions and 492 deletions.
3 changes: 2 additions & 1 deletion front/lib/bus_arrival_page.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//버스 도착 정보 페이지
import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
import 'dart:convert';
Expand Down Expand Up @@ -250,7 +251,7 @@ class _BusArrivalPageState extends State<BusArrivalPage> {
fontWeight: FontWeight.bold,
),
),
const TextSpan(text: ' 정류장\n'),
const TextSpan(text: '번째 정류장\n'),
const TextSpan(
text: '사색의광장',
),
Expand Down
1 change: 1 addition & 0 deletions front/lib/bus_company.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//버스 회사 데이터
const Map<String, dynamic> companyData = {"1":
{
"name":"용남고속",
Expand Down
1 change: 1 addition & 0 deletions front/lib/bus_history_page.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//과거 버스 도착 정보(버스별) 페이지
import 'package:flutter/material.dart';
import 'dart:convert';
import 'package:http/http.dart' as http;
Expand Down
1 change: 1 addition & 0 deletions front/lib/bus_info.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//버스 노선 데이터
const Map<String,String> busRouteMap={
"9": "200000103",
"1112": "234000016",
Expand Down
3 changes: 1 addition & 2 deletions front/lib/bus_screen.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
//버스 노선 페이지
import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
import 'dart:convert';
import 'bus_timetable_page.dart';
import 'bus_arrival_page.dart';
class BusScreen extends StatelessWidget {
Expand Down
1 change: 1 addition & 0 deletions front/lib/bus_timetable_page.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//버스 시간표 페이지
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

Expand Down
109 changes: 109 additions & 0 deletions front/lib/company_info_page.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
//회사 정보 페이지
import 'package:flutter/material.dart';
import 'bus_company.dart';


class CompanyInfoPage extends StatelessWidget {
final String companyId;

const CompanyInfoPage({super.key, required this.companyId});

@override
Widget build(BuildContext context) {
final company = companyData[companyId];

return Scaffold(
appBar: AppBar(
leading: IconButton(
icon: const Icon(Icons.arrow_back),
onPressed: () => Navigator.pop(context),
),
title: Text('${company['name']}'),
),
body: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text(
'회사 정보',
style: TextStyle(
fontSize: 16,
color: Colors.grey,
),
),
const SizedBox(height: 16),
_buildInfoCard(company),
],
),
),
);
}

Widget _buildInfoCard(Map<String, dynamic> company) {
return Container(
decoration: BoxDecoration(
border: Border.all(color: Colors.grey.shade300),
borderRadius: BorderRadius.circular(8),
),
child: Column(
children: [
_buildInfoItem(
icon: Icons.link,
title: '웹사이트 주소',
content: company['url'] ?? 'none',
),
_buildDivider(),
_buildInfoItem(
icon: Icons.phone,
title: '전화번호',
content: _formatPhones(company['phones']),
),
if (company['address'] != null) ...[
_buildDivider(),
_buildInfoItem(
icon: Icons.home,
title: '주소',
content: company['address'],
),
],
],
),
);
}

Widget _buildInfoItem({
required IconData icon,
required String title,
required String content,
}) {
return Padding(
padding: const EdgeInsets.all(16.0),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Icon(icon, size: 24, color: Colors.black54),
const SizedBox(width: 12),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(content),
],
),
),
],
),
);
}

Widget _buildDivider() {
return const Divider(height: 1, thickness: 1);
}

String _formatPhones(Map<String, dynamic> phones) {
return phones.entries
.map((e) => '${e.key}: ${e.value}')
.join('\n');
}
}
Loading

0 comments on commit f73ee31

Please sign in to comment.