-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from Brian0KIM/uxImproving
Ux improving
- Loading branch information
Showing
14 changed files
with
678 additions
and
492 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
//버스 회사 데이터 | ||
const Map<String, dynamic> companyData = {"1": | ||
{ | ||
"name":"용남고속", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
//버스 노선 데이터 | ||
const Map<String,String> busRouteMap={ | ||
"9": "200000103", | ||
"1112": "234000016", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
//버스 시간표 페이지 | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter/services.dart'; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); | ||
} | ||
} |
Oops, something went wrong.