-
Notifications
You must be signed in to change notification settings - Fork 1
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
1 parent
dd4199c
commit fc6c8ab
Showing
10 changed files
with
183 additions
and
15 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
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,12 @@ | ||
class GoodsCard { | ||
final String title; | ||
final double? regularPrice; | ||
final double? discountRate; | ||
final double discountedPrice; | ||
|
||
const GoodsCard( | ||
{required this.title, | ||
required this.discountedPrice, | ||
this.discountRate, | ||
this.regularPrice}); | ||
} |
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,13 @@ | ||
import 'package:flutter/cupertino.dart'; | ||
|
||
class GoodsDetailScreen extends StatelessWidget { | ||
const GoodsDetailScreen({super.key}); | ||
|
||
static const routeName = "goodsDetail"; | ||
static const routePath = "/goodsDetail"; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return const Placeholder(); | ||
} | ||
} |
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
86 changes: 86 additions & 0 deletions
86
lib/features/tutis/widgets/tuti_widgets/goods_container.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,86 @@ | ||
import 'package:flutter/cupertino.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter/widgets.dart'; | ||
import 'package:flutter_screenutil/flutter_screenutil.dart'; | ||
import 'package:intl/intl.dart'; | ||
import 'package:tuti/constants/color.dart'; | ||
|
||
class GoodsContainer extends StatelessWidget { | ||
const GoodsContainer( | ||
{super.key, | ||
required this.title, | ||
required this.discountedPrice, | ||
this.discountRate, | ||
this.regularPrice}); | ||
|
||
final String title; | ||
final double? regularPrice; | ||
final double? discountRate; | ||
final double discountedPrice; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final numberFormat = NumberFormat.currency( | ||
locale: 'ko_KR', | ||
symbol: '', | ||
); | ||
return GestureDetector( | ||
onTap: () {}, | ||
child: Container( | ||
width: MediaQuery.of(context).size.width * 0.8, | ||
margin: EdgeInsets.symmetric(horizontal: 45.w, vertical: 8.h), | ||
padding: EdgeInsets.symmetric(horizontal: 25.w, vertical: 30.h), | ||
decoration: BoxDecoration( | ||
color: ColorConstants.primaryColor, | ||
borderRadius: BorderRadius.circular(25.sp), | ||
), | ||
child: Column( | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
Text( | ||
title, | ||
style: Theme.of(context) | ||
.textTheme | ||
.bodyLarge! | ||
.copyWith(color: Colors.white), | ||
), | ||
if (regularPrice != null) | ||
Text( | ||
numberFormat.format(regularPrice), | ||
style: Theme.of(context).textTheme.bodyLarge!.copyWith( | ||
color: Colors.white, | ||
fontSize: 22.sp, | ||
decoration: TextDecoration.lineThrough, | ||
decorationColor: | ||
ColorConstants.personalBrandingDividerColor, | ||
decorationThickness: 2.0), | ||
), | ||
if (regularPrice == null) | ||
RSizedBox( | ||
height: 35.w, | ||
), | ||
if (discountRate != null) | ||
Text( | ||
'${numberFormat.format(discountRate)}%할인', | ||
style: Theme.of(context).textTheme.bodyLarge!.copyWith( | ||
fontSize: 18.sp, | ||
color: ColorConstants.personalBrandingTextHighlightColor), | ||
), | ||
if (discountRate == null) | ||
RSizedBox( | ||
height: 35.w, | ||
), | ||
Text( | ||
numberFormat.format(discountedPrice), | ||
style: Theme.of(context).textTheme.bodyLarge!.copyWith( | ||
color: Colors.white, | ||
fontSize: 35.sp, | ||
fontWeight: FontWeight.w900), | ||
), | ||
], | ||
), | ||
), | ||
); | ||
} | ||
} |
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
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