Skip to content

Commit bfea364

Browse files
committed
✨ :: Image 추가
1 parent 48c48af commit bfea364

6 files changed

Lines changed: 82 additions & 51 deletions

File tree

example/lib/main.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,11 @@ class ComponentTestScreen extends StatelessWidget {
155155

156156
ButtonBuy(buttonText: '예시 텍스트'),
157157
SizedBox(height: 16.h),
158-
JusicoolIcons.search(),
158+
159+
JusicoolImage.cloud(
160+
width: 100.w,
161+
height: 100.h,
162+
),
159163
],
160164
),
161165
),

lib/src/core/theme.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
export 'theme/colors.dart';
22
export 'theme/texts.dart';
3-
export 'theme/icons.dart';
3+
export 'theme/icons.dart';
4+
export 'theme/images.dart';

lib/src/core/theme/icons/icons.dart

Lines changed: 3 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import 'package:flutter/material.dart';
22
import 'package:flutter_svg/svg.dart';
33

4-
class JusicoolIcons {
5-
JusicoolIcons._();
4+
class JusicoolIcon {
5+
JusicoolIcon._();
66

77
static Widget _buildIcon(
88
String fileName, {
@@ -68,33 +68,6 @@ class JusicoolIcons {
6868
_buildIcon('back_arrow.svg',
6969
color: color, width: width, height: height, onTap: onTap);
7070

71-
static Widget cards({
72-
Color? color,
73-
double width = 24,
74-
double height = 24,
75-
VoidCallback? onTap,
76-
}) =>
77-
_buildIcon('cards.svg',
78-
color: color, width: width, height: height, onTap: onTap);
79-
80-
static Widget check({
81-
Color? color,
82-
double width = 24,
83-
double height = 24,
84-
VoidCallback? onTap,
85-
}) =>
86-
_buildIcon('check.svg',
87-
color: color, width: width, height: height, onTap: onTap);
88-
89-
static Widget cloud({
90-
Color? color,
91-
double width = 24,
92-
double height = 24,
93-
VoidCallback? onTap,
94-
}) =>
95-
_buildIcon('cloud.svg',
96-
color: color, width: width, height: height, onTap: onTap);
97-
9871
static Widget forwardArrow({
9972
Color? color,
10073
double width = 24,
@@ -104,15 +77,6 @@ class JusicoolIcons {
10477
_buildIcon('forward_arrow.svg',
10578
color: color, width: width, height: height, onTap: onTap);
10679

107-
static Widget graphic({
108-
Color? color,
109-
double width = 24,
110-
double height = 24,
111-
VoidCallback? onTap,
112-
}) =>
113-
_buildIcon('graphic.svg',
114-
color: color, width: width, height: height, onTap: onTap);
115-
11680
static Widget heart({
11781
Color? color,
11882
double width = 24,
@@ -122,15 +86,6 @@ class JusicoolIcons {
12286
_buildIcon('heart.svg',
12387
color: color, width: width, height: height, onTap: onTap);
12488

125-
static Widget jusicoolLogo({
126-
Color? color,
127-
double width = 24,
128-
double height = 24,
129-
VoidCallback? onTap,
130-
}) =>
131-
_buildIcon('JUSICOOL_LOGO.svg',
132-
color: color, width: width, height: height, onTap: onTap);
133-
13489
static Widget pencilLine({
13590
Color? color,
13691
double width = 24,
@@ -164,7 +119,7 @@ class JusicoolIcons {
164119
double height = 24,
165120
VoidCallback? onTap,
166121
}) =>
167-
_buildIcon('send.svg',
122+
_buildIcon('send_button.svg',
168123
color: color, width: width, height: height, onTap: onTap);
169124

170125
static Widget setting({

lib/src/core/theme/images.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export 'images/images.dart';
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
import 'dart:ui';
2+
3+
import 'package:flutter/cupertino.dart';
4+
5+
class JusicoolImage {
6+
JusicoolImage._();
7+
8+
static Widget _buildImage(
9+
String fileName, {
10+
Color? color,
11+
double width = 24,
12+
double height = 24,
13+
VoidCallback? onTap,
14+
}) {
15+
return GestureDetector(
16+
onTap: onTap,
17+
child: Image.asset(
18+
'packages/jusicool_design_system/assets/images/$fileName',
19+
color: color,
20+
width: width,
21+
height: height,
22+
),
23+
);
24+
}
25+
26+
static Widget card({
27+
Color? color,
28+
double width = 24,
29+
double height = 24,
30+
VoidCallback? onTap,
31+
}) =>
32+
_buildImage('card.png',
33+
color: color, width: width, height: height, onTap: onTap);
34+
35+
static Widget checkCoin({
36+
Color? color,
37+
double width = 24,
38+
double height = 24,
39+
VoidCallback? onTap,
40+
}) =>
41+
_buildImage('check_coin.png',
42+
color: color, width: width, height: height, onTap: onTap);
43+
44+
static Widget cloud({
45+
Color? color,
46+
double width = 24,
47+
double height = 24,
48+
VoidCallback? onTap,
49+
}) =>
50+
_buildImage('cloud.png',
51+
color: color, width: width, height: height, onTap: onTap);
52+
53+
static Widget graphic({
54+
Color? color,
55+
double width = 24,
56+
double height = 24,
57+
VoidCallback? onTap,
58+
}) =>
59+
_buildImage('graphic.png',
60+
color: color, width: width, height: height, onTap: onTap);
61+
62+
static Widget logo({
63+
Color? color,
64+
double width = 24,
65+
double height = 24,
66+
VoidCallback? onTap,
67+
}) =>
68+
_buildImage('JUSICOOL_LOGO.png',
69+
color: color, width: width, height: height, onTap: onTap);
70+
}

lib/src/ui/widgets/text_filed/comments.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class _CommentTextFieldState extends State<CommentTextField> {
6161
),
6262
suffixIcon: GestureDetector(
6363
onTap: _submitText,
64-
child: JusicoolIcons.send(
64+
child: JusicoolIcon.send(
6565
width: 36.w,
6666
height: 36.h,
6767
color: _hasText ? JusicoolColor.main : JusicoolColor.gray400,

0 commit comments

Comments
 (0)