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

Feature/#11 detail menu UI #12

Merged
merged 3 commits into from
Feb 26, 2023
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
97 changes: 97 additions & 0 deletions lib/screens/camera/detailed_result_true.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';
final Uri _url = Uri.parse('https://www.google.com/search?q=%EC%95%84%EB%A9%94%EB%A6%AC%EC%B9%B4%EB%85%B8');

class DetailResultTrue extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
alignment: Alignment.topCenter,
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage('assets/images/background.png'),
fit:BoxFit.fitWidth,
alignment: Alignment.topCenter
),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const SizedBox(height: 30),
const Text('κ²°κ³Ό 확인',
style: TextStyle(
fontSize: 30,
fontWeight:FontWeight.bold ,
color: Colors.black,
),
),
const SizedBox(height: 20),
SizedBox(width: 300,height: 500,
child:
Card(
shape: RoundedRectangleBorder( //λͺ¨μ„œλ¦¬λ₯Ό λ‘₯κΈ€κ²Œ ν•˜κΈ° μœ„ν•΄ μ‚¬μš©
borderRadius: BorderRadius.circular(16.0),
),
elevation: 4.0, // 그림자 깊이
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Text('아메리카노',
style: TextStyle(
fontSize: 40,
color: Colors.black,
),),
const SizedBox(height: 15),
const Icon(
Icons.coffee,
color: Colors.brown,
size: 200,),
const Padding(padding: EdgeInsets.symmetric(horizontal: 50.0,vertical: 20.0),
child: Text('μ—μŠ€ν”„λ ˆμ†Œμ— 뜨거운 물을 λ”ν•œ 음료',
style: TextStyle(
fontSize: 20,
color: Colors.black),
textAlign: TextAlign.center,
maxLines: 2,
),
),
TextButton(
onPressed: _launchUrl,
child: const Text('검색 κ²°κ³Ό 더보기',
style: TextStyle(color: Colors.blue,
decoration: TextDecoration.underline),),
),
],
)
),

),

const SizedBox(height: 30),
ElevatedButton(
onPressed: (){Navigator.pop(context);},
style: ElevatedButton.styleFrom(
primary: Color(0xFFFFD700),
onPrimary: Colors.black,
minimumSize: Size(300, 40),
padding: const EdgeInsets.symmetric(horizontal: 40, vertical: 20),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20),
),
),
child: Text('λͺ©λ‘μœΌλ‘œ', style: TextStyle(fontSize: 30)),
),
const SizedBox(height: 10),
],
),
),
);
}

Future<void> _launchUrl() async {
if (!await launchUrl(_url)) {
throw Exception('Could not launch $_url');
}
}
}
7 changes: 7 additions & 0 deletions lib/screens/camera/result_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:i_can_read/configs/color.dart';
import 'package:i_can_read/configs/curve_painter.dart';
import 'package:i_can_read/models/menu.dart';
import 'package:i_can_read/models/menu_repository.dart';
import 'package:i_can_read/screens/camera/detailed_result_true.dart';

class ResultScreen extends StatelessWidget {
ResultScreen({super.key});
Expand Down Expand Up @@ -51,6 +52,12 @@ class MenuTile extends StatelessWidget {
child: ListTile(
title: Text(menu.name, style: const TextStyle(fontSize: 28)),
subtitle: Text(menu.description, style: const TextStyle(fontSize: 20)),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => DetailResultTrue()),
);
},
leading: AspectRatio(
aspectRatio: 1,
child: Image.network(menu.image, width: 100, fit: BoxFit.cover)
Expand Down
2 changes: 1 addition & 1 deletion lib/screens/recommend/recommend_result.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class RecommendResultScreen extends StatelessWidget {
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children:const [
Text('<b>아메리카노</b>',
Text('아메리카노',
style: TextStyle(
fontSize: 40,
color: Colors.black,
Expand Down
3 changes: 2 additions & 1 deletion lib/screens/recommend/recommend_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,13 @@ class RecommendScreen extends StatelessWidget {
primary: Color(0xFFC6ECCD),
onPrimary: Colors.black,
minimumSize: const Size(300, 200),
maximumSize: const Size(300, 200),
padding: const EdgeInsets.symmetric(horizontal: 40, vertical: 20),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20),
),
),
child: Text('카페인 미포함', style: TextStyle(fontSize: 40)),
child: Text('카페인\n미포함', style: TextStyle(fontSize: 40)),
),
const SizedBox(height: 10),
Row(
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ dependencies:
cupertino_icons: ^1.0.2
camera: ^0.10.2+1
path_provider: ^2.0.12
url_launcher: ^6.0.18
url_launcher: ^6.1.10

dev_dependencies:
flutter_test:
Expand Down