-
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.
- Loading branch information
Showing
9 changed files
with
125 additions
and
3 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -0,0 +1,96 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter/services.dart'; | ||
|
||
class BusTimeTablePage extends StatelessWidget { | ||
final String routeNumber; | ||
|
||
const BusTimeTablePage({ | ||
super.key, | ||
required this.routeNumber, | ||
}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
appBar: AppBar( | ||
leading: IconButton( | ||
icon: const Icon(Icons.arrow_back), | ||
onPressed: () => Navigator.pop(context), | ||
), | ||
title: const Text('버스 시간표 조회'), | ||
), | ||
body: Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
Padding( | ||
padding: const EdgeInsets.all(16.0), | ||
child: Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
Text( | ||
routeNumber, | ||
style: const TextStyle( | ||
fontSize: 24, | ||
fontWeight: FontWeight.bold, | ||
), | ||
), | ||
], | ||
), | ||
), | ||
Expanded( | ||
child: _buildTimeTableImage(context), | ||
), | ||
], | ||
), | ||
); | ||
} | ||
|
||
Widget _buildTimeTableImage(BuildContext context) { | ||
return Center( | ||
child: SingleChildScrollView( | ||
child: Padding( | ||
padding: const EdgeInsets.all(16.0), | ||
child: Card( | ||
shape: RoundedRectangleBorder( | ||
borderRadius: BorderRadius.circular(12.0), | ||
side: const BorderSide(color: Colors.blue, width: 1), | ||
), | ||
child: ClipRRect( | ||
borderRadius: BorderRadius.circular(12.0), | ||
child: Image.asset( | ||
'timetables/$routeNumber.jpg', | ||
fit: BoxFit.contain, | ||
errorBuilder: (context, error, stackTrace) { | ||
return Center( | ||
child: Padding( | ||
padding: const EdgeInsets.all(20.0), | ||
child: Column( | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
children: [ | ||
const Icon( | ||
Icons.error_outline, | ||
size: 48, | ||
color: Colors.grey, | ||
), | ||
const SizedBox(height: 16), | ||
Text( | ||
'$routeNumber번 버스의\n시간표 정보가 없습니다.', | ||
textAlign: TextAlign.center, | ||
style: const TextStyle( | ||
fontSize: 16, | ||
color: Colors.grey, | ||
), | ||
), | ||
], | ||
), | ||
), | ||
); | ||
}, | ||
), | ||
), | ||
), | ||
), | ||
), | ||
); | ||
} | ||
} |
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